diff options
author | Chris Lattner <sabre@nondot.org> | 2003-04-16 20:51:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-04-16 20:51:36 +0000 |
commit | 56620da5b486225dfbb0db02d5cbc5c976d0dc02 (patch) | |
tree | 0b2d23834845038af3a7c3d41dacb0ee4c0314ec /tools/opt | |
parent | 53997416228333e105b06df22acd400de0505c89 (diff) | |
download | llvm-56620da5b486225dfbb0db02d5cbc5c976d0dc02.tar.gz llvm-56620da5b486225dfbb0db02d5cbc5c976d0dc02.tar.bz2 llvm-56620da5b486225dfbb0db02d5cbc5c976d0dc02.tar.xz |
Give verbose error messages if bytecode file cannot be parsed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt')
-rw-r--r-- | tools/opt/opt.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 803f4c6993..6633dd18cb 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -76,11 +76,16 @@ int main(int argc, char **argv) { 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; } |