From 48db02d0d921faded40a05912717a380e0f62642 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 16 Jul 2009 19:05:41 +0000 Subject: Privatize the ConstantFP table. I'm on a roll! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76097 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 +- lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 4491eb2..85ade6f 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -916,7 +916,7 @@ SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, bool isTarget) { SDValue SelectionDAG::getConstantFP(const APFloat& V, MVT VT, bool isTarget) { - return getConstantFP(*ConstantFP::get(V), VT, isTarget); + return getConstantFP(*Context->getConstantFP(V), VT, isTarget); } SDValue SelectionDAG::getConstantFP(const ConstantFP& V, MVT VT, bool isTarget){ diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 4f90bb3..3c85118 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -2146,7 +2146,8 @@ void SelectionDAGLowering::visitFSub(User &I) { const VectorType *DestTy = cast(I.getType()); const Type *ElTy = DestTy->getElementType(); unsigned VL = DestTy->getNumElements(); - std::vector NZ(VL, Context->getConstantFPNegativeZero(ElTy)); + std::vector NZ(VL, + DAG.getContext()->getConstantFPNegativeZero(ElTy)); Constant *CNZ = DAG.getContext()->getConstantVector(&NZ[0], NZ.size()); if (CV == CNZ) { SDValue Op2 = getValue(I.getOperand(1)); @@ -2158,7 +2159,7 @@ void SelectionDAGLowering::visitFSub(User &I) { } if (ConstantFP *CFP = dyn_cast(I.getOperand(0))) if (CFP->isExactlyValue( - Context->getConstantFPNegativeZero(Ty)->getValueAPF())) { + DAG.getContext()->getConstantFPNegativeZero(Ty)->getValueAPF())) { SDValue Op2 = getValue(I.getOperand(1)); setValue(&I, DAG.getNode(ISD::FNEG, getCurDebugLoc(), Op2.getValueType(), Op2)); -- cgit v1.1