mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +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) {
|
int main(int argc, char **argv) {
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm analysis printer tool\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm analysis printer tool\n");
|
||||||
|
|
||||||
CurrentModule = ParseBytecodeFile(InputFilename);
|
try {
|
||||||
if (!CurrentModule && !(CurrentModule = ParseAssemblyFile(InputFilename))) {
|
CurrentModule = ParseBytecodeFile(InputFilename);
|
||||||
std::cerr << "Input file didn't read correctly.\n";
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user