diff options
author | Chris Lattner <sabre@nondot.org> | 2002-07-30 21:43:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-07-30 21:43:25 +0000 |
commit | d4c7f2766bcf2cf87e562ea4e71cb4b54d81b74e (patch) | |
tree | 5a811d0aedf27c0608e0342a3051aaed5cff6015 /tools/llvm-as | |
parent | 50e3a20b54be93fce84f70075730b8d38c0318d7 (diff) | |
download | external_llvm-d4c7f2766bcf2cf87e562ea4e71cb4b54d81b74e.zip external_llvm-d4c7f2766bcf2cf87e562ea4e71cb4b54d81b74e.tar.gz external_llvm-d4c7f2766bcf2cf87e562ea4e71cb4b54d81b74e.tar.bz2 |
Print the tool name when an error comes from so that I can tell which
tool of a pipeline is having issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-as')
-rw-r--r-- | tools/llvm-as/as.cpp | 12 | ||||
-rw-r--r-- | tools/llvm-as/llvm-as.cpp | 12 |
2 files changed, 14 insertions, 10 deletions
diff --git a/tools/llvm-as/as.cpp b/tools/llvm-as/as.cpp index 36f8456..7593cef 100644 --- a/tools/llvm-as/as.cpp +++ b/tools/llvm-as/as.cpp @@ -40,7 +40,7 @@ int main(int argc, char **argv) { // Parse the file now... std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename)); if (M.get() == 0) { - cerr << "assembly didn't read correctly.\n"; + cerr << argv[0] << ": assembly didn't read correctly.\n"; return 1; } @@ -49,7 +49,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; } @@ -71,7 +72,8 @@ 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; } @@ -84,13 +86,13 @@ int main(int argc, char **argv) { } if (!Out->good()) { - cerr << "Error opening " << OutputFilename << "!\n"; + cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; return 1; } WriteBytecodeToFile(M.get(), *Out); } catch (const ParseException &E) { - cerr << E.getMessage() << std::endl; + cerr << argv[0] << ": " << E.getMessage() << "\n"; return 1; } diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp index 36f8456..7593cef 100644 --- a/tools/llvm-as/llvm-as.cpp +++ b/tools/llvm-as/llvm-as.cpp @@ -40,7 +40,7 @@ int main(int argc, char **argv) { // Parse the file now... std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename)); if (M.get() == 0) { - cerr << "assembly didn't read correctly.\n"; + cerr << argv[0] << ": assembly didn't read correctly.\n"; return 1; } @@ -49,7 +49,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; } @@ -71,7 +72,8 @@ 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; } @@ -84,13 +86,13 @@ int main(int argc, char **argv) { } if (!Out->good()) { - cerr << "Error opening " << OutputFilename << "!\n"; + cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; return 1; } WriteBytecodeToFile(M.get(), *Out); } catch (const ParseException &E) { - cerr << E.getMessage() << std::endl; + cerr << argv[0] << ": " << E.getMessage() << "\n"; return 1; } |