llvm.org GIT mirror llvm / ad217a4
Fix bug: Linker/2003-08-28-TypeResolvesGlobal2.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8206 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 2 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
235235 "Two planes folded together with overlapping value names!");
236236
237237 // Make sure that ExistGV is the one we want to keep!
238 if (!NewGV->isExternal() || !NewGV->use_empty()) {
238 if (!NewGV->isExternal())
239239 std::swap(NewGV, ExistGV);
240 }
241240
242241 // Ok we have two external global values. Make all uses of the new
243242 // one use the old one...
244 //
245 assert(NewGV->use_empty() && "No uses allowed on untyped value!");
246
247 // We cannot replaceAllUsesWith, because they have different types!
248 //NewGV->replaceAllUsesWith(ExistGV);
243 NewGV->uncheckedReplaceAllUsesWith(ExistGV);
249244
250245 // Now we just convert it to an unnamed method... which won't get
251246 // added to our symbol table. The problem is that if we call