diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-07-30 21:43:22 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-07-30 21:43:22 +0000 |
| commit | da4c6cc151c3beabdd2ffcac21f16bda18458627 (patch) | |
| tree | 1a4ae40ffdd2d6dda4993ca561bc8d2de58eba10 /llvm/tools | |
| parent | dcd3ec6010dc0c592826d6811b040199426d9783 (diff) | |
| download | bcm5719-llvm-da4c6cc151c3beabdd2ffcac21f16bda18458627.tar.gz bcm5719-llvm-da4c6cc151c3beabdd2ffcac21f16bda18458627.zip | |
Print the tool name when an error comes from so that I can tell which
tool of a pipeline is having issues.
llvm-svn: 3167
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/analyze/analyze.cpp | 7 | ||||
| -rw-r--r-- | llvm/tools/extract/extract.cpp | 2 | ||||
| -rw-r--r-- | llvm/tools/gccld/gccld.cpp | 8 | ||||
| -rw-r--r-- | llvm/tools/llc/llc.cpp | 10 |
4 files changed, 16 insertions, 11 deletions
diff --git a/llvm/tools/analyze/analyze.cpp b/llvm/tools/analyze/analyze.cpp index 79bcc4c5bdc..ade03debb55 100644 --- a/llvm/tools/analyze/analyze.cpp +++ b/llvm/tools/analyze/analyze.cpp @@ -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); diff --git a/llvm/tools/extract/extract.cpp b/llvm/tools/extract/extract.cpp index cfadff08115..e904beac80c 100644 --- a/llvm/tools/extract/extract.cpp +++ b/llvm/tools/extract/extract.cpp @@ -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; } diff --git a/llvm/tools/gccld/gccld.cpp b/llvm/tools/gccld/gccld.cpp index 5649796aaea..51131052b42 100644 --- a/llvm/tools/gccld/gccld.cpp +++ b/llvm/tools/gccld/gccld.cpp @@ -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"; diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp index f5ba08c0895..88f327d7aed 100644 --- a/llvm/tools/llc/llc.cpp +++ b/llvm/tools/llc/llc.cpp @@ -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; } |

