Add a non-exiting diagnostic handler for LTO.
[oota-llvm.git] / tools / llvm-lto / llvm-lto.cpp
index ddde23175a3bc44b003e23fdcca5a1a309e214c7..cdb1bcaa6bca388d737f24dcc533bb57222258cf 100644 (file)
@@ -216,8 +216,11 @@ int main(int argc, char **argv) {
     if (SetMergedModule && i == BaseArg) {
       // Transfer ownership to the code generator.
       CodeGen.setModule(std::move(Module));
-    } else if (!CodeGen.addModule(Module.get()))
+    } else if (!CodeGen.addModule(Module.get())) {
+      // Print a message here so that we know addModule() did not abort.
+      errs() << argv[0] << ": error adding file '" << InputFilenames[i] << "'\n";
       return 1;
+    }
   }
 
   // Add all the exported symbols to the table of symbols to preserve.