summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-13 00:50:17 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-13 00:50:17 +0000
commitbfe26ffcfc6e23e0c43e9a8de02c5d656403e872 (patch)
treebf5f6c8a8773d75520c567fc5f5323b69db109ff /llvm/lib/Transforms/Utils
parentd845dc00c710f30b1449466bbf41afaf8536ed07 (diff)
downloadbcm5719-llvm-bfe26ffcfc6e23e0c43e9a8de02c5d656403e872.tar.gz
bcm5719-llvm-bfe26ffcfc6e23e0c43e9a8de02c5d656403e872.zip
Replace CastInst::createInferredCast calls with more accurate cast
creation calls. llvm-svn: 32521
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/LowerAllocations.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerAllocations.cpp b/llvm/lib/Transforms/Utils/LowerAllocations.cpp
index d011d754757..30b0ab827e0 100644
--- a/llvm/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/llvm/lib/Transforms/Utils/LowerAllocations.cpp
@@ -135,7 +135,8 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
} else {
Value *Scale = MI->getOperand(0);
if (Scale->getType() != IntPtrTy)
- Scale = CastInst::createInferredCast(Scale, IntPtrTy, "", I);
+ Scale = CastInst::createIntegerCast(Scale, IntPtrTy, false /*ZExt*/,
+ "", I);
// Multiply it by the array size if necessary...
MallocArg = BinaryOperator::create(Instruction::Mul, Scale,
@@ -149,13 +150,12 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
if (MallocFTy->getNumParams() > 0 || MallocFTy->isVarArg()) {
if (MallocFTy->isVarArg()) {
if (MallocArg->getType() != IntPtrTy)
- MallocArg = CastInst::createInferredCast(MallocArg, IntPtrTy, "",
- I);
+ MallocArg = CastInst::createIntegerCast(MallocArg, IntPtrTy,
+ false /*ZExt*/, "", I);
} else if (MallocFTy->getNumParams() > 0 &&
MallocFTy->getParamType(0) != Type::UIntTy)
- MallocArg =
- CastInst::createInferredCast(MallocArg, MallocFTy->getParamType(0),
- "",I);
+ MallocArg = CastInst::createIntegerCast(
+ MallocArg, MallocFTy->getParamType(0), false/*ZExt*/, "",I);
MallocArgs.push_back(MallocArg);
}
@@ -170,7 +170,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
// Create a cast instruction to convert to the right type...
Value *MCast;
if (MCall->getType() != Type::VoidTy)
- MCast = CastInst::createInferredCast(MCall, MI->getType(), "", I);
+ MCast = new BitCastInst(MCall, MI->getType(), "", I);
else
MCast = Constant::getNullValue(MI->getType());
@@ -187,8 +187,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
Value *MCast = FI->getOperand(0);
if (FreeFTy->getNumParams() > 0 &&
FreeFTy->getParamType(0) != MCast->getType())
- MCast = CastInst::createInferredCast(MCast, FreeFTy->getParamType(0),
- "", I);
+ MCast = new BitCastInst(MCast, FreeFTy->getParamType(0), "", I);
FreeArgs.push_back(MCast);
}
OpenPOWER on IntegriCloud