mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
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
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user