mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
For PR797:
Rid the Assembly Parser of exceptions. This is a really gross hack but it will do until the Assembly Parser is re-written as a recursive descent. The basic premise is that wherever the old "ThrowException" function was called (new name: GenerateError) we set a flag (TriggerError). Every production checks that flag and calls YYERROR if it is set. Additionally, each call to ThrowException in the grammar is replaced with GEN_ERROR which calls GenerateError and then YYERROR immediately. This prevents the remaining production from continuing after an error condition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29763 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -137,17 +137,10 @@ int main(int argc, char **argv) {
|
||||
" llvm .s -> .o assembler for GCC\n");
|
||||
sys::PrintStackTraceOnErrorSignal();
|
||||
|
||||
std::auto_ptr<Module> M;
|
||||
try {
|
||||
// Parse the file now...
|
||||
M.reset(ParseAssemblyFile(InputFilename));
|
||||
} catch (const ParseException &E) {
|
||||
std::cerr << argv[0] << ": " << E.getMessage() << "\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
ParseError Err;
|
||||
std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename,&Err));
|
||||
if (M.get() == 0) {
|
||||
std::cerr << argv[0] << ": assembly didn't read correctly.\n";
|
||||
std::cerr << argv[0] << ": " << Err.getMessage() << "\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user