diff options
author | Bill Wendling <isanbard@gmail.com> | 2006-12-17 05:15:13 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2006-12-17 05:15:13 +0000 |
commit | 5c7e326585f3a543388ba871c3425f7664cd9143 (patch) | |
tree | 85de3d1ef8b725fb5db8a5e36c5d312da657cab6 /lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp | |
parent | 89b0d995d26d9e70b9c8d7fab8b99f1e89ac11bb (diff) | |
download | llvm-5c7e326585f3a543388ba871c3425f7664cd9143.tar.gz llvm-5c7e326585f3a543388ba871c3425f7664cd9143.tar.bz2 llvm-5c7e326585f3a543388ba871c3425f7664cd9143.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp index 65da788961..0b10a22fc4 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp @@ -473,7 +473,8 @@ private: /// 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 @@ private: /// 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 @@ void ScheduleDAGSimple::AddToGroup(NodeInfo *D, NodeInfo *U) { /// 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 @@ static bool isFlagUser(SDNode *A) { /// 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 |