From 42fbc7e809db5efb2f89323c4fd5888d9cbf88d4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 26 May 2004 17:08:25 +0000 Subject: [PATCH] A quick and ugly hack to fix PR345. I used TypeTy specifically to make Reid cringe :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13788 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/llvmAsmParser.y | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 98d79e01c9d..a5a844b1d8e 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -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.