mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
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
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user