summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-as/llvm-as.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-07-30 21:43:25 +0000
committerChris Lattner <sabre@nondot.org>2002-07-30 21:43:25 +0000
commit6f43f6d136b69ffd31dee04281f96c2a1d7d2270 (patch)
tree75499b6c7b541fe54c6e4460d45924f163ab3482 /llvm/tools/llvm-as/llvm-as.cpp
parentda4c6cc151c3beabdd2ffcac21f16bda18458627 (diff)
downloadbcm5719-llvm-6f43f6d136b69ffd31dee04281f96c2a1d7d2270.tar.gz
bcm5719-llvm-6f43f6d136b69ffd31dee04281f96c2a1d7d2270.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: 3168
Diffstat (limited to 'llvm/tools/llvm-as/llvm-as.cpp')
-rw-r--r--llvm/tools/llvm-as/llvm-as.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp
index 36f84568783..7593cef4b0f 100644
--- a/llvm/tools/llvm-as/llvm-as.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud