summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-ar/llvm-ar.cpp16
-rw-r--r--tools/llvm-ranlib/llvm-ranlib.cpp3
2 files changed, 14 insertions, 5 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp
index fdcc9e6404..8bc9e048da 100644
--- a/tools/llvm-ar/llvm-ar.cpp
+++ b/tools/llvm-ar/llvm-ar.cpp
@@ -484,7 +484,9 @@ void doDelete() {
}
// We're done editting, reconstruct the archive.
- TheArchive->writeToDisk(SymTable,TruncateNames,Compression);
+ std::string errmsg;
+ if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,&errmsg))
+ throw errmsg;
if (ReallyVerbose)
printSymbolTable();
}
@@ -536,7 +538,9 @@ void doMove() {
}
// We're done editting, reconstruct the archive.
- TheArchive->writeToDisk(SymTable,TruncateNames,Compression);
+ std::string errmsg;
+ if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,&errmsg))
+ throw errmsg;
if (ReallyVerbose)
printSymbolTable();
}
@@ -555,7 +559,9 @@ void doQuickAppend() {
}
// We're done editting, reconstruct the archive.
- TheArchive->writeToDisk(SymTable,TruncateNames,Compression);
+ std::string errmsg;
+ if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,&errmsg))
+ throw errmsg;
if (ReallyVerbose)
printSymbolTable();
}
@@ -642,7 +648,9 @@ void doReplaceOrInsert() {
}
// We're done editting, reconstruct the archive.
- TheArchive->writeToDisk(SymTable,TruncateNames,Compression);
+ std::string errmsg;
+ if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,&errmsg))
+ throw errmsg;
if (ReallyVerbose)
printSymbolTable();
}
diff --git a/tools/llvm-ranlib/llvm-ranlib.cpp b/tools/llvm-ranlib/llvm-ranlib.cpp
index 1c372d5f7d..a3cdc4119d 100644
--- a/tools/llvm-ranlib/llvm-ranlib.cpp
+++ b/tools/llvm-ranlib/llvm-ranlib.cpp
@@ -74,7 +74,8 @@ int main(int argc, char **argv) {
if (!TheArchive)
throw err_msg;
- TheArchive->writeToDisk(true, false, false );
+ if (!TheArchive->writeToDisk(true, false, false, &err_msg ))
+ throw err_msg;
if (Verbose)
printSymbolTable(TheArchive);