Fix bug: Linker/2003-08-28-TypeResolvesGlobal2.ll
authorChris Lattner <sabre@nondot.org>
Fri, 29 Aug 2003 05:11:34 +0000 (05:11 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 29 Aug 2003 05:11:34 +0000 (05:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8206 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/SymbolTable.cpp

index b5476178db83536258558b08d883d59fe81eff9a..5a365dd330d480ad958453d828518421b3dfbd8e 100644 (file)
@@ -236,17 +236,12 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
                  "Two planes folded together with overlapping value names!");
 
           // Make sure that ExistGV is the one we want to keep!
-          if (!NewGV->isExternal() || !NewGV->use_empty()) {
+          if (!NewGV->isExternal())
             std::swap(NewGV, ExistGV);
-          }
 
           // Ok we have two external global values.  Make all uses of the new
           // one use the old one...
-          //
-          assert(NewGV->use_empty() && "No uses allowed on untyped value!");
-
-          // We cannot replaceAllUsesWith, because they have different types!
-          //NewGV->replaceAllUsesWith(ExistGV);
+          NewGV->uncheckedReplaceAllUsesWith(ExistGV);
           
           // Now we just convert it to an unnamed method... which won't get
           // added to our symbol table.  The problem is that if we call