aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/llvm-ar/llvm-ar.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp
index 8f90de7bde..586639bd63 100644
--- a/tools/llvm-ar/llvm-ar.cpp
+++ b/tools/llvm-ar/llvm-ar.cpp
@@ -677,7 +677,12 @@ int main(int argc, char **argv) {
std::cerr << argv[0] << ": creating " << ArchivePath.toString() << "\n";
TheArchive = Archive::CreateEmpty(ArchivePath);
} else {
- TheArchive = Archive::OpenAndLoad(ArchivePath);
+ std::string Error;
+ TheArchive = Archive::OpenAndLoad(ArchivePath, &Error);
+ if (TheArchive == 0)
+ std::cerr << argv[0] << ": error loading '" << ArchivePath << "': "
+ << Error << "!\n";
+ return 1;
}
// Make sure we're not fooling ourselves.