diff options
author | Dan Gohman <gohman@apple.com> | 2008-11-19 21:32:03 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-11-19 21:32:03 +0000 |
commit | 252ae9e8ae4efaf1f67a608ad2563323308bd803 (patch) | |
tree | 0573ae3ed0b0c72f216736ad03ec58a3d52990d3 /lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | |
parent | eb22065a3593668d46abd1d9943e5b9ae8e02e50 (diff) |
Convert SUnit's dump method into a print method and implement
dump in terms of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index da68cd5029..b63c3c1cf1 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -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 @@ void ScheduleDAG::Run() { /// 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 { |