mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
To not barf when an error occurs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10236 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5b266581fb
commit
4257098c36
@ -554,10 +554,6 @@ static bool setValueName(Value *V, char *NameStr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the symbol table so it doesn't complain when it
|
|
||||||
// gets destructed
|
|
||||||
CurFun.LocalSymtab.clear();
|
|
||||||
|
|
||||||
ThrowException("Redefinition of value named '" + Name + "' in the '" +
|
ThrowException("Redefinition of value named '" + Name + "' in the '" +
|
||||||
V->getType()->getDescription() + "' type plane!");
|
V->getType()->getDescription() + "' type plane!");
|
||||||
}
|
}
|
||||||
@ -572,10 +568,6 @@ static bool setValueName(Value *V, char *NameStr) {
|
|||||||
|
|
||||||
// If it already exists
|
// If it already exists
|
||||||
if (Existing) {
|
if (Existing) {
|
||||||
// Clear the symbol table so it doesn't complain when it
|
|
||||||
// gets destructed
|
|
||||||
CurFun.LocalSymtab.clear();
|
|
||||||
|
|
||||||
// Bail
|
// Bail
|
||||||
ThrowException("Redefinition of value named '" + Name + "' in the '" +
|
ThrowException("Redefinition of value named '" + Name + "' in the '" +
|
||||||
V->getType()->getDescription() + "' type plane!");
|
V->getType()->getDescription() + "' type plane!");
|
||||||
@ -646,7 +638,15 @@ Module *RunVMAsmParser(const std::string &Filename, FILE *F) {
|
|||||||
|
|
||||||
// Allocate a new module to read
|
// Allocate a new module to read
|
||||||
CurModule.CurrentModule = new Module(Filename);
|
CurModule.CurrentModule = new Module(Filename);
|
||||||
|
|
||||||
|
try {
|
||||||
yyparse(); // Parse the file.
|
yyparse(); // Parse the file.
|
||||||
|
} catch (...) {
|
||||||
|
// Clear the symbol table so it doesn't complain when it
|
||||||
|
// gets destructed
|
||||||
|
CurFun.LocalSymtab.clear();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
Module *Result = ParserResult;
|
Module *Result = ParserResult;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user