From: Eric Christopher Date: Wed, 8 Oct 2014 01:57:58 +0000 (+0000) Subject: Have the selection dag grab TargetLowering off of the subtarget X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=48b1918a1b5428ca4bafe923884829aa9aaccf7e;p=oota-llvm.git Have the selection dag grab TargetLowering off of the subtarget inside init rather than have it passed in as an argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219270 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 8be27d029d5..f737be5022f 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -268,7 +268,7 @@ public: /// init - Prepare this SelectionDAG to process code in the given /// MachineFunction. /// - void init(MachineFunction &mf, const TargetLowering *TLI); + void init(MachineFunction &mf); /// clear - Clear state and free memory necessary to make this /// SelectionDAG ready to process a new block. diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 25532ec1ba7..5c89665ce66 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -915,9 +915,9 @@ SelectionDAG::SelectionDAG(const TargetMachine &tm, CodeGenOpt::Level OL) DbgInfo = new SDDbgInfo(); } -void SelectionDAG::init(MachineFunction &mf, const TargetLowering *tli) { +void SelectionDAG::init(MachineFunction &mf) { MF = &mf; - TLI = tli; + TLI = getSubtarget().getTargetLowering(); TSI = getSubtarget().getSelectionDAGInfo(); Context = &mf.getFunction()->getContext(); } diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 31f4b068b90..860a85e59fe 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -413,7 +413,6 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { const Function &Fn = *mf.getFunction(); const TargetInstrInfo &TII = *TM.getSubtargetImpl()->getInstrInfo(); const TargetRegisterInfo &TRI = *TM.getSubtargetImpl()->getRegisterInfo(); - const TargetLowering *TLI = TM.getSubtargetImpl()->getTargetLowering(); MF = &mf; RegInfo = &MF->getRegInfo(); @@ -433,7 +432,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { SplitCriticalSideEffectEdges(const_cast(Fn), this); - CurDAG->init(*MF, TLI); + CurDAG->init(*MF); FuncInfo->set(Fn, *MF, CurDAG); if (UseMBPI && OptLevel != CodeGenOpt::None)