* Fix a bug (test/Regression/Assembler/2002-05-02-InvalidForwardRef.ll)
authorChris Lattner <sabre@nondot.org>
Thu, 2 May 2002 19:27:42 +0000 (19:27 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 2 May 2002 19:27:42 +0000 (19:27 +0000)
  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

lib/AsmParser/llvmAsmParser.y

index 020a83df49d10fb21b1796081016deaacbd5de17..697609a3fa511b28ac102ab4ac4be092e14b7763 100644 (file)
@@ -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));