[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp

Bill Wendling isanbard at gmail.com
Sat Dec 16 21:15:52 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

ScheduleDAGSimple.cpp updated: 1.21 -> 1.22
---
Log message:

Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.


---
Diffs of the changes:  (+13 -11)

 ScheduleDAGSimple.cpp |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.21 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.22
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.21	Mon Dec 11 13:15:36 2006
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp	Sat Dec 16 23:15:13 2006
@@ -473,7 +473,8 @@
   
   /// print - Print ordering to specified output stream.
   ///
-  void print(OStream &O) const;
+  void print(std::ostream &O) const;
+  void print(std::ostream *O) const { if (O) print(*O); }
   
   void dump(const char *tag) const;
   
@@ -485,7 +486,8 @@
 
   /// printNI - Print node info.
   ///
-  void printNI(OStream &O, NodeInfo *NI) const;
+  void printNI(std::ostream &O, NodeInfo *NI) const;
+  void printNI(std::ostream *O, NodeInfo *NI) const { if (O) printNI(O, NI); }
   
   /// printChanges - Hilight changes in order caused by scheduling.
   ///
@@ -636,7 +638,7 @@
 
 /// print - Print ordering to specified output stream.
 ///
-void ScheduleDAGSimple::print(OStream &O) const {
+void ScheduleDAGSimple::print(std::ostream &O) const {
 #ifndef NDEBUG
   O << "Ordering\n";
   for (unsigned i = 0, N = Ordering.size(); i < N; i++) {
@@ -710,16 +712,16 @@
 
 /// printNI - Print node info.
 ///
-void ScheduleDAGSimple::printNI(OStream &O, NodeInfo *NI) const {
+void ScheduleDAGSimple::printNI(std::ostream &O, NodeInfo *NI) const {
 #ifndef NDEBUG
   SDNode *Node = NI->Node;
-  *(O.stream()) << " "
-                << std::hex << Node << std::dec
-                << ", Lat=" << NI->Latency
-                << ", Slot=" << NI->Slot
-                << ", ARITY=(" << Node->getNumOperands() << ","
-                << Node->getNumValues() << ")"
-                << " " << Node->getOperationName(&DAG);
+  O << " "
+    << std::hex << Node << std::dec
+    << ", Lat=" << NI->Latency
+    << ", Slot=" << NI->Slot
+    << ", ARITY=(" << Node->getNumOperands() << ","
+    << Node->getNumValues() << ")"
+    << " " << Node->getOperationName(&DAG);
   if (isFlagDefiner(Node)) O << "<#";
   if (isFlagUser(Node)) O << ">#";
 #endif






More information about the llvm-commits mailing list