[llvm-commits] CVS: llvm/tools/opt/opt.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Apr 16 15:52:03 PDT 2003
Changes in directory llvm/tools/opt:
opt.cpp updated: 1.77 -> 1.78
---
Log message:
Give verbose error messages if bytecode file cannot be parsed
---
Diffs of the changes:
Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.77 llvm/tools/opt/opt.cpp:1.78
--- llvm/tools/opt/opt.cpp:1.77 Wed Feb 26 14:00:41 2003
+++ llvm/tools/opt/opt.cpp Wed Apr 16 15:51:36 2003
@@ -76,11 +76,16 @@
std::auto_ptr<TargetMachine> target;
TargetMachine* TM = NULL;
+ std::string ErrorMessage;
// Load the input module...
- std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename));
+ std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename, &ErrorMessage));
if (M.get() == 0) {
- cerr << argv[0] << ": bytecode didn't read correctly.\n";
+ cerr << argv[0] << ": ";
+ if (ErrorMessage.size())
+ cerr << ErrorMessage << "\n";
+ else
+ cerr << "bytecode didn't read correctly.\n";
return 1;
}
More information about the llvm-commits
mailing list