SlotIndexes: Introduce an iterator into the idx2MBBMap.
[oota-llvm.git] / include / llvm / CodeGen / ResourcePriorityQueue.h
index 66a60396684234dc61ad8aa26c2d06ea9117f82a..0097e0472e5c51cb6b9b6f9376fc9b71265cece8 100644 (file)
@@ -14,8 +14,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef RESOURCE_PRIORITY_QUEUE_H
-#define RESOURCE_PRIORITY_QUEUE_H
+#ifndef LLVM_CODEGEN_RESOURCEPRIORITYQUEUE_H
+#define LLVM_CODEGEN_RESOURCEPRIORITYQUEUE_H
 
 #include "llvm/CodeGen/DFAPacketizer.h"
 #include "llvm/CodeGen/ScheduleDAG.h"
@@ -64,7 +64,7 @@ namespace llvm {
     /// ResourcesModel - Represents VLIW state.
     /// Not limited to VLIW targets per say, but assumes
     /// definition of DFA by a target.
-    DFAPacketizer *ResourcesModel;
+    std::unique_ptr<DFAPacketizer> ResourcesModel;
 
     /// Resource model - packet/bundle model. Purely
     /// internal at the time.
@@ -77,22 +77,18 @@ namespace llvm {
   public:
     ResourcePriorityQueue(SelectionDAGISel *IS);
 
-    ~ResourcePriorityQueue() {
-      delete ResourcesModel;
-    }
-
-    bool isBottomUp() const { return false; }
+    bool isBottomUp() const override { return false; }
 
-    void initNodes(std::vector<SUnit> &sunits);
+    void initNodes(std::vector<SUnit> &sunits) override;
 
-    void addNode(const SUnit *SU) {
+    void addNode(const SUnit *SU) override {
       NumNodesSolelyBlocking.resize(SUnits->size(), 0);
     }
 
-    void updateNode(const SUnit *SU) {}
+    void updateNode(const SUnit *SU) override {}
 
-    void releaseState() {
-      SUnits = 0;
+    void releaseState() override {
+      SUnits = nullptr;
     }
 
     unsigned getLatency(unsigned NodeNum) const {
@@ -116,18 +112,16 @@ namespace llvm {
     signed regPressureDelta(SUnit *SU, bool RawPressure = false);
     signed rawRegPressureDelta (SUnit *SU, unsigned RCId);
 
-    bool empty() const { return Queue.empty(); }
-
-    virtual void push(SUnit *U);
+    bool empty() const override { return Queue.empty(); }
 
-    virtual SUnit *pop();
+    void push(SUnit *U) override;
 
-    virtual void remove(SUnit *SU);
+    SUnit *pop() override;
 
-    virtual void dump(ScheduleDAG* DAG) const;
+    void remove(SUnit *SU) override;
 
     /// scheduledNode - Main resource tracking point.
-    void scheduledNode(SUnit *Node);
+    void scheduledNode(SUnit *Node) override;
     bool isResourceAvailable(SUnit *SU);
     void reserveResources(SUnit *SU);