Fix PR130, and testcase test/Regression/Linker/2003-11-18-TypeResolution.ll
authorChris Lattner <sabre@nondot.org>
Wed, 19 Nov 2003 01:02:52 +0000 (01:02 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 19 Nov 2003 01:02:52 +0000 (01:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10075 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/SymbolTable.cpp

index 834d6198982071eb60699d53ee14a7b3667b346d..f2e5398d4117cc128885b80d59610098f765f7f9 100644 (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);