Print the tool name when an error comes from so that I can tell which

tool of a pipeline is having issues.

llvm-svn: 3166
This commit is contained in:
Chris Lattner 2002-07-30 19:52:14 +00:00
parent 1e4867fed2
commit dcd3ec6010
3 changed files with 18 additions and 18 deletions

View File

@ -50,15 +50,15 @@ int main(int argc, char **argv) {
Module *M = ParseBytecodeFile(InputFilename);
if (M == 0) {
cerr << "bytecode didn't read correctly.\n";
cerr << argv[0] << ": bytecode didn't read correctly.\n";
return 1;
}
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! Sending to standard output.\n";
cerr << argv[0] << ": error opening '" << OutputFilename
<< "': file exists! Sending to standard output.\n";
} else {
Out = new std::ofstream(OutputFilename.c_str());
}
@ -81,8 +81,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! Sending to standard output.\n";
cerr << argv[0] << ": error opening '" << OutputFilename
<< "': file exists! Sending to standard output.\n";
} else {
Out = new std::ofstream(OutputFilename.c_str());
@ -94,7 +94,7 @@ int main(int argc, char **argv) {
}
if (!Out->good()) {
cerr << "Error opening " << OutputFilename
cerr << argv[0] << ": error opening " << OutputFilename
<< ": sending to stdout instead!\n";
Out = &std::cout;
}

View File

@ -50,15 +50,15 @@ int main(int argc, char **argv) {
Module *M = ParseBytecodeFile(InputFilename);
if (M == 0) {
cerr << "bytecode didn't read correctly.\n";
cerr << argv[0] << ": bytecode didn't read correctly.\n";
return 1;
}
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! Sending to standard output.\n";
cerr << argv[0] << ": error opening '" << OutputFilename
<< "': file exists! Sending to standard output.\n";
} else {
Out = new std::ofstream(OutputFilename.c_str());
}
@ -81,8 +81,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! Sending to standard output.\n";
cerr << argv[0] << ": error opening '" << OutputFilename
<< "': file exists! Sending to standard output.\n";
} else {
Out = new std::ofstream(OutputFilename.c_str());
@ -94,7 +94,7 @@ int main(int argc, char **argv) {
}
if (!Out->good()) {
cerr << "Error opening " << OutputFilename
cerr << argv[0] << ": error opening " << OutputFilename
<< ": sending to stdout instead!\n";
Out = &std::cout;
}

View File

@ -50,15 +50,15 @@ int main(int argc, char **argv) {
Module *M = ParseBytecodeFile(InputFilename);
if (M == 0) {
cerr << "bytecode didn't read correctly.\n";
cerr << argv[0] << ": bytecode didn't read correctly.\n";
return 1;
}
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! Sending to standard output.\n";
cerr << argv[0] << ": error opening '" << OutputFilename
<< "': file exists! Sending to standard output.\n";
} else {
Out = new std::ofstream(OutputFilename.c_str());
}
@ -81,8 +81,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! Sending to standard output.\n";
cerr << argv[0] << ": error opening '" << OutputFilename
<< "': file exists! Sending to standard output.\n";
} else {
Out = new std::ofstream(OutputFilename.c_str());
@ -94,7 +94,7 @@ int main(int argc, char **argv) {
}
if (!Out->good()) {
cerr << "Error opening " << OutputFilename
cerr << argv[0] << ": error opening " << OutputFilename
<< ": sending to stdout instead!\n";
Out = &std::cout;
}