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
This commit is contained in:
Chris Lattner 2004-05-26 17:08:25 +00:00
parent 94c43590ef
commit 42fbc7e809

View 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.