[llvm-commits] CVS: llvm/tools/dis/dis.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Apr 16 15:52:01 PDT 2003
Changes in directory llvm/tools/dis:
dis.cpp updated: 1.28 -> 1.29
---
Log message:
Give verbose error messages if bytecode file cannot be parsed
---
Diffs of the changes:
Index: llvm/tools/dis/dis.cpp
diff -u llvm/tools/dis/dis.cpp:1.28 llvm/tools/dis/dis.cpp:1.29
--- llvm/tools/dis/dis.cpp:1.28 Mon Sep 23 19:09:48 2002
+++ llvm/tools/dis/dis.cpp Wed Apr 16 15:51:35 2003
@@ -48,10 +48,15 @@
int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, " llvm .bc -> .ll disassembler\n");
std::ostream *Out = &std::cout; // Default to printing to stdout...
+ std::string ErrorMessage;
- 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