[llvm] r219262 - Have SelectionDAG's subtarget TargetSelectionDAGInfo be set

Eric Christopher echristo at gmail.com
Tue Oct 7 17:32:59 PDT 2014


Author: echristo
Date: Tue Oct  7 19:32:59 2014
New Revision: 219262

URL: http://llvm.org/viewvc/llvm-project?rev=219262&view=rev
Log:
Have SelectionDAG's subtarget TargetSelectionDAGInfo be set
during init rather than construction time.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=219262&r1=219261&r2=219262&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Oct  7 19:32:59 2014
@@ -907,8 +907,7 @@ unsigned SelectionDAG::getEVTAlignment(E
 
 // EntryNode could meaningfully have debug info if we can find it...
 SelectionDAG::SelectionDAG(const TargetMachine &tm, CodeGenOpt::Level OL)
-    : TM(tm), TSI(tm.getSubtargetImpl()->getSelectionDAGInfo()), TLI(nullptr),
-      OptLevel(OL),
+    : TM(tm), TSI(nullptr), TLI(nullptr), OptLevel(OL),
       EntryNode(ISD::EntryToken, 0, DebugLoc(), getVTList(MVT::Other)),
       Root(getEntryNode()), NewNodesMustHaveLegalTypes(false),
       UpdateListeners(nullptr) {
@@ -919,6 +918,7 @@ SelectionDAG::SelectionDAG(const TargetM
 void SelectionDAG::init(MachineFunction &mf, const TargetLowering *tli) {
   MF = &mf;
   TLI = tli;
+  TSI = getSubtarget().getSelectionDAGInfo();
   Context = &mf.getFunction()->getContext();
 }
 





More information about the llvm-commits mailing list