[llvm-commits] CVS: llvm/tools/llvm-ar/llvm-ar.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Dec 14 23:44:31 PST 2004



Changes in directory llvm/tools/llvm-ar:

llvm-ar.cpp updated: 1.23 -> 1.24
---
Log message:

Do not fail an assertion on a broken archive


---
Diffs of the changes:  (+6 -1)

Index: llvm/tools/llvm-ar/llvm-ar.cpp
diff -u llvm/tools/llvm-ar/llvm-ar.cpp:1.23 llvm/tools/llvm-ar/llvm-ar.cpp:1.24
--- llvm/tools/llvm-ar/llvm-ar.cpp:1.23	Tue Dec 14 19:53:50 2004
+++ llvm/tools/llvm-ar/llvm-ar.cpp	Wed Dec 15 01:44:15 2004
@@ -677,7 +677,12 @@
         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.






More information about the llvm-commits mailing list