From 6ab7a4f9ef212ef6824677d0de84189c1233e56a Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 17 Nov 2004 18:25:21 +0000 Subject: [PATCH] Make sure we parse bytecode with a module identifier that reflects the full name of the module: "Archive.a(object.o)" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17917 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Archive/ArchiveReader.cpp | 12 +++++++++--- lib/Bytecode/Archive/ArchiveReader.cpp | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp index 2dae5b65397..615df2bf5f2 100644 --- a/lib/Archive/ArchiveReader.cpp +++ b/lib/Archive/ArchiveReader.cpp @@ -282,8 +282,10 @@ Archive::getAllModules(std::vector& Modules, std::string* ErrMessage) { for (iterator I=begin(), E=end(); I != E; ++I) { if (I->isBytecode() || I->isCompressedBytecode()) { + std::string FullMemberName = archPath.get() + + "(" + I->getPath().get() + ")"; Module* M = ParseBytecodeBuffer((const unsigned char*)I->getData(), - I->getSize(), I->getPath().get(), ErrMessage); + I->getSize(), FullMemberName, ErrMessage); if (!M) return true; @@ -391,9 +393,11 @@ Archive::findModuleDefiningSymbol(const std::string& symbol) { ArchiveMember* mbr = parseMemberHeader(modptr, base + mapfile->size()); // Now, load the bytecode module to get the ModuleProvider + std::string FullMemberName = archPath.get() + "(" + + mbr->getPath().get() + ")"; ModuleProvider* mp = getBytecodeBufferModuleProvider( (const unsigned char*) mbr->getData(), mbr->getSize(), - mbr->getPath().get(), 0); + FullMemberName, 0); modules.insert(std::make_pair(fileOffset,std::make_pair(mp,mbr))); @@ -428,8 +432,10 @@ Archive::findModulesDefiningSymbols(const std::set& symbols, if (mbr->isBytecode() || mbr->isCompressedBytecode()) { // Get the symbols std::vector symbols; + std::string FullMemberName = archPath.get() + "(" + + mbr->getPath().get() + ")"; ModuleProvider* MP = GetBytecodeSymbols((const unsigned char*)At, - mbr->getSize(), mbr->getPath().get(),symbols); + mbr->getSize(), FullMemberName, symbols); if (MP) { // Insert the module's symbols into the symbol table diff --git a/lib/Bytecode/Archive/ArchiveReader.cpp b/lib/Bytecode/Archive/ArchiveReader.cpp index 2dae5b65397..615df2bf5f2 100644 --- a/lib/Bytecode/Archive/ArchiveReader.cpp +++ b/lib/Bytecode/Archive/ArchiveReader.cpp @@ -282,8 +282,10 @@ Archive::getAllModules(std::vector& Modules, std::string* ErrMessage) { for (iterator I=begin(), E=end(); I != E; ++I) { if (I->isBytecode() || I->isCompressedBytecode()) { + std::string FullMemberName = archPath.get() + + "(" + I->getPath().get() + ")"; Module* M = ParseBytecodeBuffer((const unsigned char*)I->getData(), - I->getSize(), I->getPath().get(), ErrMessage); + I->getSize(), FullMemberName, ErrMessage); if (!M) return true; @@ -391,9 +393,11 @@ Archive::findModuleDefiningSymbol(const std::string& symbol) { ArchiveMember* mbr = parseMemberHeader(modptr, base + mapfile->size()); // Now, load the bytecode module to get the ModuleProvider + std::string FullMemberName = archPath.get() + "(" + + mbr->getPath().get() + ")"; ModuleProvider* mp = getBytecodeBufferModuleProvider( (const unsigned char*) mbr->getData(), mbr->getSize(), - mbr->getPath().get(), 0); + FullMemberName, 0); modules.insert(std::make_pair(fileOffset,std::make_pair(mp,mbr))); @@ -428,8 +432,10 @@ Archive::findModulesDefiningSymbols(const std::set& symbols, if (mbr->isBytecode() || mbr->isCompressedBytecode()) { // Get the symbols std::vector symbols; + std::string FullMemberName = archPath.get() + "(" + + mbr->getPath().get() + ")"; ModuleProvider* MP = GetBytecodeSymbols((const unsigned char*)At, - mbr->getSize(), mbr->getPath().get(),symbols); + mbr->getSize(), FullMemberName, symbols); if (MP) { // Insert the module's symbols into the symbol table