diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-24 23:12:02 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-24 23:12:02 +0000 |
commit | eacb44d0bb89c608c4465b7900eea3afc0f0be0d (patch) | |
tree | c7390f63d90fc0c0ac483a90275863f41b69c085 /lib/Target | |
parent | 2f099ebb73bac294783dd5ce28631d5f72d5438e (diff) | |
download | external_llvm-eacb44d0bb89c608c4465b7900eea3afc0f0be0d.tar.gz external_llvm-eacb44d0bb89c608c4465b7900eea3afc0f0be0d.tar.bz2 external_llvm-eacb44d0bb89c608c4465b7900eea3afc0f0be0d.zip |
Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/ARMBaseRegisterInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/ARM/ARMISelDAGToDAG.cpp | 3 | ||||
-rw-r--r-- | lib/Target/ARM/Thumb1RegisterInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/ARM/Thumb2RegisterInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaISelDAGToDAG.cpp | 2 | ||||
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 8 | ||||
-rw-r--r-- | lib/Target/XCore/XCoreISelDAGToDAG.cpp | 3 |
8 files changed, 11 insertions, 16 deletions
diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/lib/Target/ARM/ARMBaseRegisterInfo.cpp index d93c4edb4e..6b0692c763 100644 --- a/lib/Target/ARM/ARMBaseRegisterInfo.cpp +++ b/lib/Target/ARM/ARMBaseRegisterInfo.cpp @@ -903,8 +903,7 @@ emitLoadConstPool(MachineBasicBlock &MBB, unsigned PredReg) const { MachineFunction &MF = *MBB.getParent(); MachineConstantPool *ConstantPool = MF.getConstantPool(); - Constant *C = - MF.getFunction()->getContext().getConstantInt(Type::Int32Ty, Val); + Constant *C = ConstantInt::get(Type::Int32Ty, Val); unsigned Idx = ConstantPool->getConstantPoolIndex(C, 4); BuildMI(MBB, MBBI, dl, TII.get(ARM::LDRcp)) diff --git a/lib/Target/ARM/ARMISelDAGToDAG.cpp b/lib/Target/ARM/ARMISelDAGToDAG.cpp index cdb27c252f..794692d839 100644 --- a/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ b/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -877,8 +877,7 @@ SDNode *ARMDAGToDAGISel::Select(SDValue Op) { !ARM_AM::isSOImmTwoPartVal(Val)); // two instrs. if (UseCP) { SDValue CPIdx = - CurDAG->getTargetConstantPool( - CurDAG->getContext()->getConstantInt(Type::Int32Ty, Val), + CurDAG->getTargetConstantPool(ConstantInt::get(Type::Int32Ty, Val), TLI.getPointerTy()); SDNode *ResNode; diff --git a/lib/Target/ARM/Thumb1RegisterInfo.cpp b/lib/Target/ARM/Thumb1RegisterInfo.cpp index 0ae54b54a2..bf721a5e99 100644 --- a/lib/Target/ARM/Thumb1RegisterInfo.cpp +++ b/lib/Target/ARM/Thumb1RegisterInfo.cpp @@ -58,8 +58,7 @@ void Thumb1RegisterInfo::emitLoadConstPool(MachineBasicBlock &MBB, unsigned PredReg) const { MachineFunction &MF = *MBB.getParent(); MachineConstantPool *ConstantPool = MF.getConstantPool(); - Constant *C = - MF.getFunction()->getContext().getConstantInt(Type::Int32Ty, Val); + Constant *C = ConstantInt::get(Type::Int32Ty, Val); unsigned Idx = ConstantPool->getConstantPoolIndex(C, 4); BuildMI(MBB, MBBI, dl, TII.get(ARM::tLDRcp)) diff --git a/lib/Target/ARM/Thumb2RegisterInfo.cpp b/lib/Target/ARM/Thumb2RegisterInfo.cpp index f2351e25de..106bc256df 100644 --- a/lib/Target/ARM/Thumb2RegisterInfo.cpp +++ b/lib/Target/ARM/Thumb2RegisterInfo.cpp @@ -52,8 +52,7 @@ void Thumb2RegisterInfo::emitLoadConstPool(MachineBasicBlock &MBB, unsigned PredReg) const { MachineFunction &MF = *MBB.getParent(); MachineConstantPool *ConstantPool = MF.getConstantPool(); - Constant *C = - MF.getFunction()->getContext().getConstantInt(Type::Int32Ty, Val); + Constant *C = ConstantInt::get(Type::Int32Ty, Val); unsigned Idx = ConstantPool->getConstantPoolIndex(C, 4); BuildMI(MBB, MBBI, dl, TII.get(ARM::t2LDRpci)) diff --git a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp index 4f7ac3cf6b..f783b8bd39 100644 --- a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp +++ b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp @@ -305,7 +305,7 @@ SDNode *AlphaDAGToDAGISel::Select(SDValue Op) { // val32 >= IMM_LOW + IMM_LOW * IMM_MULT) //always true break; //(zext (LDAH (LDA))) //Else use the constant pool - ConstantInt *C = CurDAG->getContext()->getConstantInt(Type::Int64Ty, uval); + ConstantInt *C = ConstantInt::get(Type::Int64Ty, uval); SDValue CPI = CurDAG->getTargetConstantPool(C, MVT::i64); SDNode *Tmp = CurDAG->getTargetNode(Alpha::LDAHr, dl, MVT::i64, CPI, SDValue(getGlobalBaseReg(), 0)); diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index d49a02397b..4defaec163 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -3500,7 +3500,7 @@ void CWriter::visitStoreInst(StoreInst &I) { if (!ITy->isPowerOf2ByteWidth()) // We have a bit width that doesn't match an even power-of-2 byte // size. Consequently we must & the value with the type's bit mask - BitMask = I.getContext().getConstantInt(ITy, ITy->getBitMask()); + BitMask = ConstantInt::get(ITy, ITy->getBitMask()); if (BitMask) Out << "(("; writeOperand(Operand); diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 81f502b278..15c6dfead4 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -4889,10 +4889,10 @@ SDValue X86TargetLowering::LowerUINT_TO_FP_i64(SDValue Op, SelectionDAG &DAG) { // Build some magic constants. std::vector<Constant*> CV0; - CV0.push_back(Context->getConstantInt(APInt(32, 0x45300000))); - CV0.push_back(Context->getConstantInt(APInt(32, 0x43300000))); - CV0.push_back(Context->getConstantInt(APInt(32, 0))); - CV0.push_back(Context->getConstantInt(APInt(32, 0))); + CV0.push_back(ConstantInt::get(*Context, APInt(32, 0x45300000))); + CV0.push_back(ConstantInt::get(*Context, APInt(32, 0x43300000))); + CV0.push_back(ConstantInt::get(*Context, APInt(32, 0))); + CV0.push_back(ConstantInt::get(*Context, APInt(32, 0))); Constant *C0 = Context->getConstantVector(CV0); SDValue CPIdx0 = DAG.getConstantPool(C0, getPointerTy(), 16); diff --git a/lib/Target/XCore/XCoreISelDAGToDAG.cpp b/lib/Target/XCore/XCoreISelDAGToDAG.cpp index 7f6532790c..ebd0a261b8 100644 --- a/lib/Target/XCore/XCoreISelDAGToDAG.cpp +++ b/lib/Target/XCore/XCoreISelDAGToDAG.cpp @@ -174,8 +174,7 @@ SDNode *XCoreDAGToDAGISel::Select(SDValue Op) { else if (! Predicate_immU16(N)) { unsigned Val = cast<ConstantSDNode>(N)->getZExtValue(); SDValue CPIdx = - CurDAG->getTargetConstantPool( - CurDAG->getContext()->getConstantInt(Type::Int32Ty, Val), + CurDAG->getTargetConstantPool(ConstantInt::get(Type::Int32Ty, Val), TLI.getPointerTy()); return CurDAG->getTargetNode(XCore::LDWCP_lru6, dl, MVT::i32, MVT::Other, CPIdx, |