1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Convert SUnit's dump method into a print method and implement

dump in terms of it.

llvm-svn: 59665
This commit is contained in:
Dan Gohman 2008-11-19 21:32:03 +00:00
parent 212b29b9d9
commit b5ce3ebed1
2 changed files with 11 additions and 6 deletions

View File

@ -242,6 +242,7 @@ namespace llvm {
void dump(const ScheduleDAG *G) const; void dump(const ScheduleDAG *G) const;
void dumpAll(const ScheduleDAG *G) const; void dumpAll(const ScheduleDAG *G) const;
void print(raw_ostream &O, const ScheduleDAG *G) const;
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//

View File

@ -18,6 +18,7 @@
#include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm; using namespace llvm;
ScheduleDAG::ScheduleDAG(SelectionDAG *dag, MachineBasicBlock *bb, 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 /// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
/// a group of nodes flagged together. /// a group of nodes flagged together.
void SUnit::dump(const ScheduleDAG *G) const { void SUnit::print(raw_ostream &O, const ScheduleDAG *G) const {
cerr << "SU(" << NodeNum << "): "; O << "SU(" << NodeNum << "): ";
if (getNode()) { if (getNode()) {
SmallVector<SDNode *, 4> FlaggedNodes; SmallVector<SDNode *, 4> FlaggedNodes;
for (SDNode *N = getNode(); N; N = N->getFlaggedNode()) for (SDNode *N = getNode(); N; N = N->getFlaggedNode())
FlaggedNodes.push_back(N); FlaggedNodes.push_back(N);
while (!FlaggedNodes.empty()) { while (!FlaggedNodes.empty()) {
cerr << " "; O << " ";
FlaggedNodes.back()->dump(G->DAG); FlaggedNodes.back()->dump(G->DAG);
cerr << "\n"; O << "\n";
FlaggedNodes.pop_back(); FlaggedNodes.pop_back();
} }
} else { } 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 { void SUnit::dumpAll(const ScheduleDAG *G) const {