A quick and ugly hack to fix PR345. I used TypeTy specifically to make
authorChris Lattner <sabre@nondot.org>
Wed, 26 May 2004 17:08:25 +0000 (17:08 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 26 May 2004 17:08:25 +0000 (17:08 +0000)
Reid cringe :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13788 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/llvmAsmParser.y

index 98d79e01c9d96716ce4623712f973f72a36b47d4..a5a844b1d8e3691b733af4e407ecc03be850ccec 100644 (file)
@@ -515,7 +515,13 @@ static bool setValueName(Value *V, char *NameStr) {
     CurFun.CurrentFunction->getSymbolTable() : 
     CurModule.CurrentModule->getSymbolTable();
 
-  Value *Existing = ST.lookup(V->getType(), Name);
+  Value *Existing;
+  // FIXME: this is really gross
+  if (V->getType() != Type::TypeTy)
+    Existing = ST.lookup(V->getType(), Name);
+  else
+    Existing = ST.lookupType(Name);
+
   if (Existing) {    // Inserting a name that is already defined???
     // There is only one case where this is allowed: when we are refining an
     // opaque type.  In this case, Existing will be an opaque type.