Change push_all to a non-virtual function and implement it in the
authorDan Gohman <gohman@apple.com>
Wed, 26 May 2010 01:10:55 +0000 (01:10 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 26 May 2010 01:10:55 +0000 (01:10 +0000)
base class, since all the implementations are the same.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104659 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LatencyPriorityQueue.h
include/llvm/CodeGen/ScheduleDAG.h
lib/CodeGen/LatencyPriorityQueue.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

index 28b6909a2bd30018eeb825cc9b2b7263dfb478a1..18c418b103ac8f387aada9f5ab1e86418d6a15c9 100644 (file)
@@ -75,15 +75,7 @@ public:
     
     bool empty() const { return Queue.empty(); }
     
-    virtual void push(SUnit *U) {
-      push_impl(U);
-    }
-    void push_impl(SUnit *U);
-    
-    void push_all(const std::vector<SUnit *> &Nodes) {
-      for (unsigned i = 0, e = Nodes.size(); i != e; ++i)
-        push_impl(Nodes[i]);
-    }
+    virtual void push(SUnit *U);
     
     SUnit *pop() {
       if (empty()) return NULL;
index d7714029c13b3f175b2b9f342c0ac4b7797c8d40..076268b99c2061f6fb716996689a170432cd4ff9 100644 (file)
@@ -427,7 +427,12 @@ namespace llvm {
     virtual bool empty() const = 0;
     virtual void push(SUnit *U) = 0;
   
-    virtual void push_all(const std::vector<SUnit *> &Nodes) = 0;
+    void push_all(const std::vector<SUnit *> &Nodes) {
+      for (std::vector<SUnit *>::const_iterator I = Nodes.begin(),
+           E = Nodes.end(); I != E; ++I)
+        push(*I);
+    }
+
     virtual SUnit *pop() = 0;
 
     virtual void remove(SUnit *SU) = 0;
index f1bd5735439dc775add7ab57db61df115a77234c..6df7b12064b0513846b5b608c4a0f4db4507fb00 100644 (file)
@@ -68,7 +68,7 @@ SUnit *LatencyPriorityQueue::getSingleUnscheduledPred(SUnit *SU) {
   return OnlyAvailablePred;
 }
 
-void LatencyPriorityQueue::push_impl(SUnit *SU) {
+void LatencyPriorityQueue::push(SUnit *SU) {
   // Look at all of the successors of this node.  Count the number of nodes that
   // this node is the sole unscheduled node for.
   unsigned NumNodesBlocking = 0;
index 0f606b08cd5fe1f1fa85dcf09ee175110c00553d..1bc059fad12c812b48ab72c9bfdecea59e4f2b2a 100644 (file)
@@ -1115,11 +1115,6 @@ namespace {
       Queue.push(U);
     }
 
-    void push_all(const std::vector<SUnit *> &Nodes) {
-      for (unsigned i = 0, e = Nodes.size(); i != e; ++i)
-        push(Nodes[i]);
-    }
-    
     SUnit *pop() {
       if (empty()) return NULL;
       SUnit *V = Queue.top();