diff options
| author | Owen Anderson <resistor@mac.com> | 2009-07-09 17:57:24 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2009-07-09 17:57:24 +0000 |
| commit | 0504e0a2222b7c39d72c1a698a0ccedd9780b4cb (patch) | |
| tree | 3a1577751845f3982c42b6f882abe4cc1f9e8ff3 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
| parent | 17973e684d116b2fe6e450225875d702af75a4b1 (diff) | |
| download | bcm5719-llvm-0504e0a2222b7c39d72c1a698a0ccedd9780b4cb.tar.gz bcm5719-llvm-0504e0a2222b7c39d72c1a698a0ccedd9780b4cb.zip | |
Thread LLVMContext through MVT and related parts of SDISel.
llvm-svn: 75153
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 177f806dbce..260996fac7a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -797,7 +797,7 @@ void SelectionDAG::VerifyNode(SDNode *N) { unsigned SelectionDAG::getMVTAlignment(MVT VT) const { const Type *Ty = VT == MVT::iPTR ? PointerType::get(Type::Int8Ty, 0) : - VT.getTypeForMVT(); + VT.getTypeForMVT(*Context); return TLI.getTargetData()->getABITypeAlignment(Ty); } @@ -811,10 +811,11 @@ SelectionDAG::SelectionDAG(TargetLowering &tli, FunctionLoweringInfo &fli) } void SelectionDAG::init(MachineFunction &mf, MachineModuleInfo *mmi, - DwarfWriter *dw) { + DwarfWriter *dw, LLVMContext* C) { MF = &mf; MMI = mmi; DW = dw; + Context = C; } SelectionDAG::~SelectionDAG() { @@ -1387,7 +1388,7 @@ SDValue SelectionDAG::getShiftAmountOperand(SDValue Op) { SDValue SelectionDAG::CreateStackTemporary(MVT VT, unsigned minAlign) { MachineFrameInfo *FrameInfo = getMachineFunction().getFrameInfo(); unsigned ByteSize = VT.getStoreSizeInBits()/8; - const Type *Ty = VT.getTypeForMVT(); + const Type *Ty = VT.getTypeForMVT(*Context); unsigned StackAlign = std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), minAlign); @@ -1400,8 +1401,8 @@ SDValue SelectionDAG::CreateStackTemporary(MVT VT, unsigned minAlign) { SDValue SelectionDAG::CreateStackTemporary(MVT VT1, MVT VT2) { unsigned Bytes = std::max(VT1.getStoreSizeInBits(), VT2.getStoreSizeInBits())/8; - const Type *Ty1 = VT1.getTypeForMVT(); - const Type *Ty2 = VT2.getTypeForMVT(); + const Type *Ty1 = VT1.getTypeForMVT(*Context); + const Type *Ty2 = VT2.getTypeForMVT(*Context); const TargetData *TD = TLI.getTargetData(); unsigned Align = std::max(TD->getPrefTypeAlignment(Ty1), TD->getPrefTypeAlignment(Ty2)); @@ -3099,7 +3100,8 @@ bool MeetsMaxMemopRequirement(std::vector<MVT> &MemOps, MVT VT = TLI.getOptimalMemOpType(Size, Align, isSrcConst, isSrcStr, DAG); if (VT != MVT::iAny) { unsigned NewAlign = (unsigned) - TLI.getTargetData()->getABITypeAlignment(VT.getTypeForMVT()); + TLI.getTargetData()->getABITypeAlignment(VT.getTypeForMVT( + *DAG.getContext())); // If source is a string constant, this will require an unaligned load. if (NewAlign > Align && (isSrcConst || AllowUnalign)) { if (Dst.getOpcode() != ISD::FrameIndex) { |

