Print the tool name when an error comes from so that I can tell which
authorChris Lattner <sabre@nondot.org>
Tue, 30 Jul 2002 21:43:22 +0000 (21:43 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 30 Jul 2002 21:43:22 +0000 (21:43 +0000)
tool of a pipeline is having issues.

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

tools/analyze/analyze.cpp
tools/extract/extract.cpp
tools/gccld/gccld.cpp
tools/llc/llc.cpp
tools/llvm-extract/llvm-extract.cpp

index 79bcc4c5bdcf5f53dc136261d61112c2915bcea8..ade03debb55a9d6f3d43246b24f7e96cf3fe43bd 100644 (file)
@@ -101,11 +101,11 @@ int main(int argc, char **argv) {
   try {
     CurMod = ParseBytecodeFile(InputFilename);
     if (!CurMod && !(CurMod = ParseAssemblyFile(InputFilename))){
-      std::cerr << "Input file didn't read correctly.\n";
+      std::cerr << argv[0] << ": input file didn't read correctly.\n";
       return 1;
     }
   } catch (const ParseException &E) {
-    std::cerr << E.getMessage() << "\n";
+    std::cerr << argv[0] << ": " << E.getMessage() << "\n";
     return 1;
   }
 
@@ -130,7 +130,8 @@ int main(int argc, char **argv) {
         Passes.add(new ModulePassPrinter(Analysis));
 
     } else
-      cerr << "Cannot create pass: " << Analysis->getPassName() << "\n";
+      cerr << argv[0] << ": cannot create pass: "
+           << Analysis->getPassName() << "\n";
   }
 
   Passes.run(*CurMod);
index cfadff081156dbdda810a401d73e780f530c7ed0..e904beac80c599de71fad7e13730c83df1b8a477 100644 (file)
@@ -92,7 +92,7 @@ int main(int argc, char **argv) {
 
   std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename));
   if (M.get() == 0) {
-    std::cerr << "bytecode didn't read correctly.\n";
+    std::cerr << argv[0] << ": bytecode didn't read correctly.\n";
     return 1;
   }
 
index 5649796aaeac745273a97642102acdcdfd5b9099..51131052b42074104add1b148bf648b649004c29 100644 (file)
@@ -123,7 +123,7 @@ int main(int argc, char **argv) {
     if (Verbose) cerr << "Linking in '" << InputFilenames[i] << "'\n";
 
     if (LinkModules(Composite.get(), M.get(), &ErrorMessage)) {
-      cerr << "Error linking in '" << InputFilenames[i] << "': "
+      cerr << argv[0] << ": error linking in '" << InputFilenames[i] << "': "
           << ErrorMessage << "\n";
       return 1;
     }
@@ -165,7 +165,8 @@ int main(int argc, char **argv) {
   // Add the pass that writes bytecode to the output file...
   std::ofstream Out((OutputFilename+".bc").c_str());
   if (!Out.good()) {
-    cerr << "Error opening '" << OutputFilename << ".bc' for writing!\n";
+    cerr << argv[0] << ": error opening '" << OutputFilename
+         << ".bc' for writing!\n";
     return 1;
   }
   Passes.add(new WriteBytecodePass(&Out));        // Write bytecode to file...
@@ -180,7 +181,8 @@ int main(int argc, char **argv) {
   // Output the script to start the program...
   std::ofstream Out2(OutputFilename.c_str());
   if (!Out2.good()) {
-    cerr << "Error opening '" << OutputFilename << "' for writing!\n";
+    cerr << argv[0] << ": error opening '" << OutputFilename
+         << "' for writing!\n";
     return 1;
   }
   Out2 << "#!/bin/sh\nlli -q $0.bc $*\n";
index f5ba08c0895bbea749e59f152cc5c8d999435398..88f327d7aed9f2ebbb4d19804c963720e8bf1266 100644 (file)
@@ -153,7 +153,7 @@ int main(int argc, char **argv) {
   // Load the module to be compiled...
   std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename));
   if (M.get() == 0) {
-    cerr << "bytecode didn't read correctly.\n";
+    cerr << argv[0] << ": bytecode didn't read correctly.\n";
     return 1;
   }
 
@@ -183,7 +183,8 @@ int main(int argc, char **argv) {
   if (OutputFilename != "") {   // Specified an output filename?
     if (!Force && std::ifstream(OutputFilename.c_str())) {
       // If force is not specified, make sure not to overwrite a file!
-      cerr << "Error opening '" << OutputFilename << "': File exists!\n"
+      cerr << argv[0] << ": error opening '" << OutputFilename
+           << "': file exists!\n"
            << "Use -f command line argument to force output\n";
       return 1;
     }
@@ -202,14 +203,15 @@ int main(int argc, char **argv) {
 
       if (!Force && std::ifstream(OutputFilename.c_str())) {
         // If force is not specified, make sure not to overwrite a file!
-        cerr << "Error opening '" << OutputFilename << "': File exists!\n"
+        cerr << argv[0] << ": error opening '" << OutputFilename
+             << "': file exists!\n"
              << "Use -f command line argument to force output\n";
         return 1;
       }
 
       Out = new std::ofstream(OutputFilename.c_str());
       if (!Out->good()) {
-        cerr << "Error opening " << OutputFilename << "!\n";
+        cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
         delete Out;
         return 1;
       }
index cfadff081156dbdda810a401d73e780f530c7ed0..e904beac80c599de71fad7e13730c83df1b8a477 100644 (file)
@@ -92,7 +92,7 @@ int main(int argc, char **argv) {
 
   std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename));
   if (M.get() == 0) {
-    std::cerr << "bytecode didn't read correctly.\n";
+    std::cerr << argv[0] << ": bytecode didn't read correctly.\n";
     return 1;
   }