#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/PathV1.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/system_error.h"
#include <cstring>
}
}
-// Get just the externally visible defined symbols from the bitcode
-bool llvm::GetBitcodeSymbols(const sys::Path& fName,
- LLVMContext& Context,
- std::vector<std::string>& symbols,
- std::string* ErrMsg) {
- OwningPtr<MemoryBuffer> Buffer;
- if (error_code ec = MemoryBuffer::getFileOrSTDIN(fName.c_str(), Buffer)) {
- if (ErrMsg) *ErrMsg = "Could not open file '" + fName.str() + "'" + ": "
- + ec.message();
- return true;
- }
-
- Module *M = ParseBitcodeFile(Buffer.get(), Context, ErrMsg);
- if (!M)
- return true;
-
- // Get the symbols
- getSymbols(M, symbols);
-
- // Done with the module.
- delete M;
- return true;
-}
-
Module*
llvm::GetBitcodeSymbols(const char *BufPtr, unsigned Length,
const std::string& ModuleID,
#include "Archive.h"
#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/PathV1.h"
#include "llvm/Support/TimeValue.h"
#include <cstring>
return 0 == memcmp(fmag, ARFILE_MEMBER_MAGIC,2);
}
};
-
+
// Get just the externally visible defined symbols from the bitcode
- bool GetBitcodeSymbols(const sys::Path& fName,
- LLVMContext& Context,
- std::vector<std::string>& symbols,
- std::string* ErrMsg);
-
Module* GetBitcodeSymbols(const char *Buffer, unsigned Length,
const std::string& ModuleID,
LLVMContext& Context,
#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/PathV1.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/system_error.h"