[llvm-commits] [llvm] r59665 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp

Dan Gohman gohman at apple.com
Wed Nov 19 13:32:05 PST 2008


Author: djg
Date: Wed Nov 19 15:32:03 2008
New Revision: 59665

URL: http://llvm.org/viewvc/llvm-project?rev=59665&view=rev
Log:
Convert SUnit's dump method into a print method and implement
dump in terms of it.

Modified:
    llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp

Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=59665&r1=59664&r2=59665&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Wed Nov 19 15:32:03 2008
@@ -242,6 +242,7 @@
     
     void dump(const ScheduleDAG *G) const;
     void dumpAll(const ScheduleDAG *G) const;
+    void print(raw_ostream &O, const ScheduleDAG *G) const;
   };
 
   //===--------------------------------------------------------------------===//

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=59665&r1=59664&r2=59665&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed Nov 19 15:32:03 2008
@@ -18,6 +18,7 @@
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetRegisterInfo.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
 using namespace llvm;
 
 ScheduleDAG::ScheduleDAG(SelectionDAG *dag, MachineBasicBlock *bb,
@@ -459,22 +460,25 @@
 
 /// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
 /// a group of nodes flagged together.
-void SUnit::dump(const ScheduleDAG *G) const {
-  cerr << "SU(" << NodeNum << "): ";
+void SUnit::print(raw_ostream &O, const ScheduleDAG *G) const {
+  O << "SU(" << NodeNum << "): ";
   if (getNode()) {
     SmallVector<SDNode *, 4> FlaggedNodes;
     for (SDNode *N = getNode(); N; N = N->getFlaggedNode())
       FlaggedNodes.push_back(N);
     while (!FlaggedNodes.empty()) {
-      cerr << "    ";
+      O << "    ";
       FlaggedNodes.back()->dump(G->DAG);
-      cerr << "\n";
+      O << "\n";
       FlaggedNodes.pop_back();
     }
   } else {
-    cerr << "CROSS RC COPY ";
+    O << "CROSS RC COPY\n";
   }
-  cerr << "\n";
+}
+
+void SUnit::dump(const ScheduleDAG *G) const {
+  print(errs(), G);
 }
 
 void SUnit::dumpAll(const ScheduleDAG *G) const {





More information about the llvm-commits mailing list