Hrm, if there is an error loading a file, try printing a message so the
authorChris Lattner <sabre@nondot.org>
Mon, 27 Sep 2004 16:41:01 +0000 (16:41 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 27 Sep 2004 16:41:01 +0000 (16:41 +0000)
user knows that...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16524 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-link/llvm-link.cpp

index 150ab0d65ac4d6a09db549dda4aaa7c2217f8bec..6e404918b669c72ac5b3d93f2f8cf34c81fbd830 100644 (file)
@@ -80,11 +80,19 @@ int main(int argc, char **argv) {
   std::string ErrorMessage;
 
   std::auto_ptr<Module> Composite(LoadFile(InputFilenames[BaseArg]));
-  if (Composite.get() == 0) return 1;
+  if (Composite.get() == 0) {
+    std::cerr << argv[0] << ": error loading file '"
+              << InputFilenames[BaseArg] << "'\n";
+    return 1;
+  }
 
   for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) {
     std::auto_ptr<Module> M(LoadFile(InputFilenames[i]));
-    if (M.get() == 0) return 1;
+    if (M.get() == 0) {
+      std::cerr << argv[0] << ": error loading file '"
+                << InputFilenames[i] << "'\n";
+      return 1;
+    }
 
     if (Verbose) std::cerr << "Linking in '" << InputFilenames[i] << "'\n";