summaryrefslogtreecommitdiff
path: root/lib/Archive
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-25 17:43:11 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-25 17:43:11 +0000
commit0b5a504d105514178c80b886321221fbe5ac1131 (patch)
tree069c7663f74040a5d323ab404e026b4c59a2a1a9 /lib/Archive
parentac123227109303be313c3c4625b152246969e781 (diff)
For PR797:
Remove exception throwing/handling from lib/Bytecode, and adjust its users to compensate for changes in the interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29875 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive')
-rw-r--r--lib/Archive/ArchiveReader.cpp10
-rw-r--r--lib/Archive/ArchiveWriter.cpp5
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp
index 38aa07243c7..e4769cac888 100644
--- a/lib/Archive/ArchiveReader.cpp
+++ b/lib/Archive/ArchiveReader.cpp
@@ -475,14 +475,16 @@ Archive::findModuleDefiningSymbol(const std::string& symbol,
const char* modptr = base + fileOffset;
ArchiveMember* mbr = parseMemberHeader(modptr, base + mapfile->size(),ErrMsg);
if (!mbr)
- return false;
+ return 0;
// Now, load the bytecode module to get the ModuleProvider
std::string FullMemberName = archPath.toString() + "(" +
mbr->getPath().toString() + ")";
ModuleProvider* mp = getBytecodeBufferModuleProvider(
(const unsigned char*) mbr->getData(), mbr->getSize(),
- FullMemberName, 0);
+ FullMemberName, ErrMsg, 0);
+ if (!mp)
+ return 0;
modules.insert(std::make_pair(fileOffset, std::make_pair(mp, mbr)));
@@ -523,7 +525,7 @@ Archive::findModulesDefiningSymbols(std::set<std::string>& symbols,
std::string FullMemberName = archPath.toString() + "(" +
mbr->getPath().toString() + ")";
ModuleProvider* MP = GetBytecodeSymbols((const unsigned char*)At,
- mbr->getSize(), FullMemberName, symbols);
+ mbr->getSize(), FullMemberName, symbols, error);
if (MP) {
// Insert the module's symbols into the symbol table
@@ -537,7 +539,7 @@ Archive::findModulesDefiningSymbols(std::set<std::string>& symbols,
} else {
if (error)
*error = "Can't parse bytecode member: " +
- mbr->getPath().toString();
+ mbr->getPath().toString() + ": " + *error;
delete mbr;
return false;
}
diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp
index 3746dbff8a1..096a9993a81 100644
--- a/lib/Archive/ArchiveWriter.cpp
+++ b/lib/Archive/ArchiveWriter.cpp
@@ -223,7 +223,7 @@ Archive::writeMember(
member.getPath().toString()
+ ")";
ModuleProvider* MP = GetBytecodeSymbols(
- (const unsigned char*)data,fSize,FullMemberName, symbols);
+ (const unsigned char*)data,fSize,FullMemberName, symbols, ErrMsg);
// If the bytecode parsed successfully
if ( MP ) {
@@ -247,7 +247,8 @@ Archive::writeMember(
delete mFile;
}
if (ErrMsg)
- *ErrMsg = "Can't parse bytecode member: " + member.getPath().toString();
+ *ErrMsg = "Can't parse bytecode member: " + member.getPath().toString()
+ + ": " + *ErrMsg;
return true;
}
}