Changes necessary to enable linking of archives without LLVM symbol tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17811 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2004-11-15 01:20:11 +00:00
parent 6238a85e4f
commit 766b793143
6 changed files with 147 additions and 35 deletions

View File

@ -391,26 +391,27 @@ bool llvm::GetBytecodeSymbols(const sys::Path& fName,
}
}
bool llvm::GetBytecodeSymbols(const unsigned char*Buffer, unsigned Length,
ModuleProvider*
llvm::GetBytecodeSymbols(const unsigned char*Buffer, unsigned Length,
const std::string& ModuleID,
std::vector<std::string>& symbols) {
try {
std::auto_ptr<ModuleProvider>
AMP(getBytecodeBufferModuleProvider(Buffer, Length, ModuleID));
ModuleProvider* MP =
getBytecodeBufferModuleProvider(Buffer, Length, ModuleID);
// Get the module from the provider
Module* M = AMP->releaseModule();
Module* M = MP->materializeModule();
// Get the symbols
getSymbols(M, symbols);
// Done with the module
delete M;
return true;
return MP;
} catch (...) {
return false;
// Fall through
}
return 0;
}
// vim: sw=2 ai