Fix PR130, and testcase test/Regression/Linker/2003-11-18-TypeResolution.ll

llvm-svn: 10075
This commit is contained in:
Chris Lattner 2003-11-19 01:02:52 +00:00
parent c4cc197549
commit 74c55dd4f9
1 changed files with 7 additions and 0 deletions

View File

@ -271,6 +271,13 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
else
M->getGlobalList().remove(cast<GlobalVariable>(NewGV));
delete NewGV;
} else {
// If they are not global values, they must be just random values who
// happen to conflict now that types have been resolved. If this is
// the case, reinsert the value into the new plane, allowing it to get
// renamed.
assert(V.second->getType() == NewType &&"Type resolution is broken!");
insert(V.second);
}
} else {
insertEntry(V.first, NewType, V.second);