Move DAGSize to SelectionDAGISel; it's used in tablegen'd isel code.
authorEvan Cheng <evan.cheng@apple.com>
Mon, 7 Aug 2006 22:16:08 +0000 (22:16 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 7 Aug 2006 22:16:08 +0000 (22:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29547 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGISel.h

index e5d024a892f2a1e3f5bfe9c261ce9bca7d82551f..f439f21d6fa8b06db9e86ffc1b0f52524bbcf883 100644 (file)
 
 #include "llvm/Pass.h"
 #include "llvm/Constant.h"
+#include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
 
 namespace llvm {
-  class SelectionDAG;
   class SelectionDAGLowering;
   class SDOperand;
   class SSARegMap;
@@ -39,8 +39,10 @@ public:
   SSARegMap *RegMap;
   SelectionDAG *CurDAG;
   MachineBasicBlock *BB;
+  std::vector<SDNode*> TopOrder;
+  unsigned DAGSize;
 
-  SelectionDAGISel(TargetLowering &tli) : TLI(tli), JT(0,0,0,0) {}
+  SelectionDAGISel(TargetLowering &tli) : TLI(tli), DAGSize(0), JT(0,0,0,0) {}
   
   TargetLowering &getTargetLowering() { return TLI; }
 
@@ -52,6 +54,9 @@ public:
 
   virtual void EmitFunctionEntryCode(Function &Fn, MachineFunction &MF) {}
   virtual void InstructionSelectBasicBlock(SelectionDAG &SD) = 0;
+  virtual void SelectRootInit() {
+    DAGSize = CurDAG->AssignTopologicalOrder(TopOrder);
+  }
 
   /// SelectInlineAsmMemoryOperand - Select the specified address as a target
   /// addressing mode, according to the specified constraint code.  If this does