mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Catch the parse exception if bad input is provided. Much better than an abort
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1631 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
07ae06d18e
commit
7d922623e3
@ -259,9 +259,14 @@ struct {
|
||||
int main(int argc, char **argv) {
|
||||
cl::ParseCommandLineOptions(argc, argv, " llvm analysis printer tool\n");
|
||||
|
||||
CurrentModule = ParseBytecodeFile(InputFilename);
|
||||
if (!CurrentModule && !(CurrentModule = ParseAssemblyFile(InputFilename))) {
|
||||
std::cerr << "Input file didn't read correctly.\n";
|
||||
try {
|
||||
CurrentModule = ParseBytecodeFile(InputFilename);
|
||||
if (!CurrentModule && !(CurrentModule = ParseAssemblyFile(InputFilename))){
|
||||
std::cerr << "Input file didn't read correctly.\n";
|
||||
return 1;
|
||||
}
|
||||
} catch (const ParseException &E) {
|
||||
cerr << E.getMessage() << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user