// Open and completely load the archive file.
Archive*
-Archive::OpenAndLoad(const sys::Path& file, const LLVMContext& C,
+Archive::OpenAndLoad(const sys::Path& file, LLVMContext& C,
std::string* ErrorMessage) {
std::auto_ptr<Archive> result ( new Archive(file, C));
if (result->mapToMemory(ErrorMessage))
for (iterator I=begin(), E=end(); I != E; ++I) {
if (I->isBitcode()) {
- std::string FullMemberName = archPath.toString() +
- "(" + I->getPath().toString() + ")";
+ std::string FullMemberName = archPath.str() +
+ "(" + I->getPath().str() + ")";
MemoryBuffer *Buffer =
MemoryBuffer::getNewMemBuffer(I->getSize(), FullMemberName.c_str());
memcpy((char*)Buffer->getBufferStart(), I->getData(), I->getSize());
// Open the archive and load just the symbol tables
Archive* Archive::OpenAndLoadSymbols(const sys::Path& file,
- const LLVMContext& C,
+ LLVMContext& C,
std::string* ErrorMessage) {
std::auto_ptr<Archive> result ( new Archive(file, C) );
if (result->mapToMemory(ErrorMessage))
return 0;
// Now, load the bitcode module to get the ModuleProvider
- std::string FullMemberName = archPath.toString() + "(" +
- mbr->getPath().toString() + ")";
+ std::string FullMemberName = archPath.str() + "(" +
+ mbr->getPath().str() + ")";
MemoryBuffer *Buffer =MemoryBuffer::getNewMemBuffer(mbr->getSize(),
FullMemberName.c_str());
memcpy((char*)Buffer->getBufferStart(), mbr->getData(), mbr->getSize());
if (mbr->isBitcode()) {
// Get the symbols
std::vector<std::string> symbols;
- std::string FullMemberName = archPath.toString() + "(" +
- mbr->getPath().toString() + ")";
+ std::string FullMemberName = archPath.str() + "(" +
+ mbr->getPath().str() + ")";
ModuleProvider* MP =
GetBitcodeSymbols((const unsigned char*)At, mbr->getSize(),
FullMemberName, Context, symbols, error);
} else {
if (error)
*error = "Can't parse bitcode member: " +
- mbr->getPath().toString() + ": " + *error;
+ mbr->getPath().str() + ": " + *error;
delete mbr;
return false;
}
continue;
std::string FullMemberName =
- archPath.toString() + "(" + I->getPath().toString() + ")";
+ archPath.str() + "(" + I->getPath().str() + ")";
MemoryBuffer *Buffer =
MemoryBuffer::getNewMemBuffer(I->getSize(), FullMemberName.c_str());