mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +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:
parent
5399741622
commit
56620da5b4
@ -48,10 +48,15 @@ WriteMode(cl::desc("Specify the output format:"),
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -48,10 +48,15 @@ WriteMode(cl::desc("Specify the output format:"),
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -48,10 +48,15 @@ WriteMode(cl::desc("Specify the output format:"),
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user