From: Chris Lattner Date: Thu, 2 May 2002 19:27:42 +0000 (+0000) Subject: * Fix a bug (test/Regression/Assembler/2002-05-02-InvalidForwardRef.ll) X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9705a15b1a8f09cd08236ed8fbfe287b9aeedf86;p=oota-llvm.git * 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 --- diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 020a83df49d..697609a3fa5 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 &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));