[llvm-ar] Use fail() helper to reduce duplication.
[oota-llvm.git] / tools / llvm-ar / llvm-ar.cpp
index cac46d2e50b91727ec70860febbf5a443ef44a89..d60a1e2cf4a1091db86511c944e49176d22a704d 100644 (file)
@@ -390,10 +390,8 @@ static bool shouldCreateArchive(ArchiveOperation Op) {
 
 static void performReadOperation(ArchiveOperation Operation,
                                  object::Archive *OldArchive) {
-  if (Operation == Extract && OldArchive->isThin()) {
-    errs() << "extracting from a thin archive is not supported\n";
-    std::exit(1);
-  }
+  if (Operation == Extract && OldArchive->isThin())
+    fail("extracting from a thin archive is not supported");
 
   bool Filter = !Members.empty();
   for (auto &ChildOrErr : OldArchive->children()) {