diff options
author | Chris Lattner <sabre@nondot.org> | 2002-05-02 19:27:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-05-02 19:27:42 +0000 |
commit | 9705a15b1a8f09cd08236ed8fbfe287b9aeedf86 (patch) | |
tree | 5cba2ccd76c425e043b95f1b00bc175d8ef9554c | |
parent | 7dd79b6a62d762d8872252577e223b2a41bdef7b (diff) |
* Fix a bug (test/Regression/Assembler/2002-05-02-InvalidForwardRef.ll)
introduced in the 1.66 revision of this file.
* Convert a hard coded constant to a symbolic value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2436 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 020a83df49..697609a3fa 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -247,7 +247,8 @@ static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) { static Value *lookupInSymbolTable(const Type *Ty, const string &Name) { SymbolTable *SymTab = - inFunctionScope() ? CurMeth.CurrentFunction->getSymbolTable() : 0; + inFunctionScope() ? CurMeth.CurrentFunction->getSymbolTable() : + CurModule.CurrentModule->getSymbolTable(); return SymTab ? SymTab->lookup(Ty, Name) : 0; } @@ -402,7 +403,7 @@ static void ResolveDefinitions(vector<ValueList> &LateResolvers, // resolver table InsertValue(V, *FutureLateResolvers); } else { - if (DID.Type == 1) + if (DID.Type == ValID::NameVal) ThrowException("Reference to an invalid definition: '" +DID.getName()+ "' of type '" + V->getType()->getDescription() + "'", getLineNumFromPlaceHolder(V)); |