aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-09 17:57:24 +0000
committerOwen Anderson <resistor@mac.com>2009-07-09 17:57:24 +0000
commitd1474d09cbe5fdeec8ba0d6c6b52f316f3422532 (patch)
treefcc789dd22936e2ec5ec7e875d7e02f0757e6c6f /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent80c8c3178276d0988c0129fb235f5b08a2e4f66d (diff)
Thread LLVMContext through MVT and related parts of SDISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 177f806dbc..260996fac7 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/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) {