aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-26 07:24:58 +0000
committerChris Lattner <sabre@nondot.org>2003-11-26 07:24:58 +0000
commit4257098c360f598209c2b7e66579e254799e4ed5 (patch)
treef4efab8ad11c84b3e850fd29ce8b3bb6fcf26d3e /lib
parent5b266581fbf53e1baab8cf735b4285b4b630a654 (diff)
downloadexternal_llvm-4257098c360f598209c2b7e66579e254799e4ed5.zip
external_llvm-4257098c360f598209c2b7e66579e254799e4ed5.tar.gz
external_llvm-4257098c360f598209c2b7e66579e254799e4ed5.tar.bz2
To not barf when an error occurs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AsmParser/llvmAsmParser.y18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index e5018ec..5706b53 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -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 '" +
V->getType()->getDescription() + "' type plane!");
}
@@ -572,10 +568,6 @@ static bool setValueName(Value *V, char *NameStr) {
// If it already exists
if (Existing) {
- // Clear the symbol table so it doesn't complain when it
- // gets destructed
- CurFun.LocalSymtab.clear();
-
// Bail
ThrowException("Redefinition of value named '" + Name + "' in the '" +
V->getType()->getDescription() + "' type plane!");
@@ -646,7 +638,15 @@ Module *RunVMAsmParser(const std::string &Filename, FILE *F) {
// Allocate a new module to read
CurModule.CurrentModule = new Module(Filename);
- yyparse(); // Parse the file.
+
+ try {
+ 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;