From b341b0861dcfdfd4453b32169a86302a275b81c9 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Tue, 12 Dec 2006 05:05:00 +0000 Subject: Change inferred getCast into specific getCast. Passes all tests. llvm-svn: 32469 --- llvm/lib/Linker/LinkModules.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'llvm/lib/Linker/LinkModules.cpp') diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 8f8aec1abd9..433dfa682d6 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -508,7 +508,8 @@ static bool LinkGlobals(Module *Dest, Module *Src, DGV->isConstant(), DGV->getLinkage()); NewDGV->setAlignment(DGV->getAlignment()); Dest->getGlobalList().insert(DGV, NewDGV); - DGV->replaceAllUsesWith(ConstantExpr::getCast(NewDGV, DGV->getType())); + DGV->replaceAllUsesWith( + ConstantExpr::getBitCast(NewDGV, DGV->getType())); DGV->eraseFromParent(); NewDGV->setName(SGV->getName()); DGV = NewDGV; @@ -529,9 +530,8 @@ static bool LinkGlobals(Module *Dest, Module *Src, SGV->setInitializer(0); } - ValueMap.insert(std::make_pair(SGV, - ConstantExpr::getCast(DGV, - SGV->getType()))); + ValueMap.insert( + std::make_pair(SGV, ConstantExpr::getBitCast(DGV, SGV->getType()))); } } return false; @@ -807,8 +807,8 @@ static bool LinkAppendingVars(Module *M, // FIXME: This should rewrite simple/straight-forward uses such as // getelementptr instructions to not use the Cast! - G1->replaceAllUsesWith(ConstantExpr::getCast(NG, G1->getType())); - G2->replaceAllUsesWith(ConstantExpr::getCast(NG, G2->getType())); + G1->replaceAllUsesWith(ConstantExpr::getBitCast(NG, G1->getType())); + G2->replaceAllUsesWith(ConstantExpr::getBitCast(NG, G2->getType())); // Remove the two globals from the module now... M->getGlobalList().erase(G1); -- cgit v1.2.3