From bb65ebf9a115340e9359dfb955be89164d16d432 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Tue, 12 Dec 2006 23:36:14 +0000 Subject: Replace inferred getCast(V,Ty) calls with more strict variants. Rename getZeroExtend and getSignExtend to getZExt and getSExt to match the the casting mnemonics in the rest of LLVM. llvm-svn: 32514 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Transforms/IPO/GlobalOpt.cpp') diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 764205baaac..cf9cdaa7444 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -708,8 +708,8 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, Constant *RepValue = NewGV; if (NewGV->getType() != GV->getType()->getElementType()) - RepValue = ConstantExpr::getCast(Instruction::BitCast, - RepValue, GV->getType()->getElementType()); + RepValue = ConstantExpr::getBitCast(RepValue, + GV->getType()->getElementType()); // If there is a comparison against null, we will insert a global bool to // keep track of whether the global was initialized yet or not. @@ -1058,8 +1058,7 @@ static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal, GV->getInitializer()->isNullValue()) { if (Constant *SOVC = dyn_cast(StoredOnceVal)) { if (GV->getInitializer()->getType() != SOVC->getType()) - SOVC = ConstantExpr::getCast(Instruction::BitCast, - SOVC, GV->getInitializer()->getType()); + SOVC = ConstantExpr::getBitCast(SOVC, GV->getInitializer()->getType()); // Optimize away any trapping uses of the loaded value. if (OptimizeAwayTrappingUsesOfLoads(GV, SOVC)) @@ -1510,7 +1509,7 @@ static GlobalVariable *InstallGlobalCtors(GlobalVariable *GCL, if (!GCL->use_empty()) { Constant *V = NGV; if (V->getType() != GCL->getType()) - V = ConstantExpr::getCast(Instruction::BitCast, V, GCL->getType()); + V = ConstantExpr::getBitCast(V, GCL->getType()); GCL->replaceAllUsesWith(V); } GCL->eraseFromParent(); -- cgit v1.2.3