aboutsummaryrefslogtreecommitdiff
path: root/tools/opt/opt.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
commitd4c7f2766bcf2cf87e562ea4e71cb4b54d81b74e (patch)
tree5a811d0aedf27c0608e0342a3051aaed5cff6015 /tools/opt/opt.cpp
parent50e3a20b54be93fce84f70075730b8d38c0318d7 (diff)
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/opt/opt.cpp')
-rw-r--r--tools/opt/opt.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 463b37c387..6f7343bae3 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -1,5 +1,5 @@
//===----------------------------------------------------------------------===//
-// LLVM 'OPT' UTILITY
+// LLVM Modular Optimizer Utility: opt
//
// Optimizations may be specified an arbitrary number of times on the command
// line, they are run in the order specified.
@@ -67,7 +67,7 @@ int main(int argc, char **argv) {
// Load the input module...
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;
}
@@ -76,14 +76,15 @@ int main(int argc, char **argv) {
if (OutputFilename != "") {
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";
return 1;
}
@@ -106,7 +107,7 @@ int main(int argc, char **argv) {
else if (Opt->getDataCtor())
Passes.add(Opt->getDataCtor()(TD)); // Pass dummy target data...
else
- cerr << "Cannot create pass: " << Opt->getPassName() << "\n";
+ cerr << argv[0] << ": cannot create pass: " << Opt->getPassName() << "\n";
if (PrintEachXForm)
Passes.add(new PrintModulePass(&cerr));