aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-ranlib/llvm-ranlib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-ranlib/llvm-ranlib.cpp')
-rw-r--r--tools/llvm-ranlib/llvm-ranlib.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/llvm-ranlib/llvm-ranlib.cpp b/tools/llvm-ranlib/llvm-ranlib.cpp
index cc86fba953..70d5cf8abf 100644
--- a/tools/llvm-ranlib/llvm-ranlib.cpp
+++ b/tools/llvm-ranlib/llvm-ranlib.cpp
@@ -64,12 +64,14 @@ int main(int argc, char **argv) {
// Make sure it exists, we don't create empty archives
if (!ArchivePath.exists())
- throw "Archive file does not exist";
+ throw std::string("Archive file does not exist");
- std::auto_ptr<Archive> AutoArchive(Archive::OpenAndLoad(ArchivePath));
+ std::string err_msg;
+ std::auto_ptr<Archive>
+ AutoArchive(Archive::OpenAndLoad(ArchivePath,&err_msg));
Archive* TheArchive = AutoArchive.get();
-
- assert(TheArchive && "Unable to instantiate the archive");
+ if (!TheArchive)
+ throw err_msg;
TheArchive->writeToDisk(true, false, false );