summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-27 20:59:43 +0000
committerOwen Anderson <resistor@mac.com>2009-07-27 20:59:43 +0000
commit69c464dec4795af43b4a432bae2b329ee5f1bef5 (patch)
tree3e3a64f042f90003a35e4cc3a91386fe47c1d11c /llvm/lib/VMCore/ConstantFold.cpp
parent7b2b1ec6b1a573c7b5909bb082ff27766774db80 (diff)
downloadbcm5719-llvm-69c464dec4795af43b4a432bae2b329ee5f1bef5.tar.gz
bcm5719-llvm-69c464dec4795af43b4a432bae2b329ee5f1bef5.zip
Move ConstantFP construction back to the 2.5-ish API.
llvm-svn: 77247
Diffstat (limited to 'llvm/lib/VMCore/ConstantFold.cpp')
-rw-r--r--llvm/lib/VMCore/ConstantFold.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/VMCore/ConstantFold.cpp b/llvm/lib/VMCore/ConstantFold.cpp
index a26bee8f950..6546dc70d80 100644
--- a/llvm/lib/VMCore/ConstantFold.cpp
+++ b/llvm/lib/VMCore/ConstantFold.cpp
@@ -161,7 +161,7 @@ static Constant *FoldBitCast(LLVMContext &Context,
return V;
if (DestTy->isFloatingPoint())
- return Context.getConstantFP(APFloat(CI->getValue(),
+ return ConstantFP::get(Context, APFloat(CI->getValue(),
DestTy != Type::PPC_FP128Ty));
// Otherwise, can't fold this (vector?)
@@ -245,7 +245,7 @@ Constant *llvm::ConstantFoldCastInstruction(LLVMContext &Context,
DestTy == Type::FP128Ty ? APFloat::IEEEquad :
APFloat::Bogus,
APFloat::rmNearestTiesToEven, &ignored);
- return Context.getConstantFP(Val);
+ return ConstantFP::get(Context, Val);
}
return 0; // Can't fold.
case Instruction::FPToUI:
@@ -279,7 +279,7 @@ Constant *llvm::ConstantFoldCastInstruction(LLVMContext &Context,
(void)apf.convertFromAPInt(api,
opc==Instruction::SIToFP,
APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(apf);
+ return ConstantFP::get(Context, apf);
}
return 0;
case Instruction::ZExt:
@@ -795,19 +795,19 @@ Constant *llvm::ConstantFoldBinaryInstruction(LLVMContext &Context,
break;
case Instruction::FAdd:
(void)C3V.add(C2V, APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(C3V);
+ return ConstantFP::get(Context, C3V);
case Instruction::FSub:
(void)C3V.subtract(C2V, APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(C3V);
+ return ConstantFP::get(Context, C3V);
case Instruction::FMul:
(void)C3V.multiply(C2V, APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(C3V);
+ return ConstantFP::get(Context, C3V);
case Instruction::FDiv:
(void)C3V.divide(C2V, APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(C3V);
+ return ConstantFP::get(Context, C3V);
case Instruction::FRem:
(void)C3V.mod(C2V, APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(C3V);
+ return ConstantFP::get(Context, C3V);
}
}
} else if (const VectorType *VTy = dyn_cast<VectorType>(C1->getType())) {
OpenPOWER on IntegriCloud