-// 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;
-}
-