From: Reid Spencer Date: Mon, 26 Mar 2007 22:38:01 +0000 (+0000) Subject: For PR1277: X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=497b0b0a455dc2300a5b8bb1e64dc3f82afc9acf;p=oota-llvm.git For PR1277: Implement error handling for bytecode parsing. Patch by Scott Michel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35364 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 376ad768b0f..a6e718707ec 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -177,10 +177,13 @@ int main(int argc, char **argv) { sys::PrintStackTraceOnErrorSignal(); // Load the module to be compiled... + std::string errmsg; std::auto_ptr M(ParseBytecodeFile(InputFilename, - Compressor::decompressToNewBuffer)); + Compressor::decompressToNewBuffer, + &errmsg)); if (M.get() == 0) { std::cerr << argv[0] << ": bytecode didn't read correctly.\n"; + std::cerr << "Reason: " << errmsg << "\n"; return 1; } Module &mod = *M.get();