diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-12 05:05:00 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-12 05:05:00 +0000 |
commit | 4da49122f3f3c8da68a52723d846b88c72166a68 (patch) | |
tree | a7cb69a70439f795df63c88c5d56200e3ae17be6 /lib/Linker/LinkModules.cpp | |
parent | a30fc5ed0430081f6495b33e027b7655ca2a66e5 (diff) |
Change inferred getCast into specific getCast. Passes all tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker/LinkModules.cpp')
-rw-r--r-- | lib/Linker/LinkModules.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 8f8aec1abd..433dfa682d 100644 --- a/lib/Linker/LinkModules.cpp +++ b/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); |