Cleanup in preparation for misched: Move DAG visualization logic.

Soon, ScheduleDAG will not refer to the BB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152177 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick
2012-03-07 00:18:22 +00:00
parent 8ceaa660bf
commit 56b94c52c9
6 changed files with 27 additions and 9 deletions
+8 -9
View File
@@ -81,18 +81,17 @@ std::string DOTGraphTraits<ScheduleDAG*>::getNodeLabel(const SUnit *SU,
/// viewGraph - Pop up a ghostview window with the reachable parts of the DAG
/// rendered using 'dot'.
///
void ScheduleDAG::viewGraph() {
// This code is only for debugging!
void ScheduleDAG::viewGraph(const Twine &Name, const Twine &Title) {
// This code is only for debugging!
#ifndef NDEBUG
if (BB->getBasicBlock())
ViewGraph(this, "dag." + MF.getFunction()->getName(), false,
"Scheduling-Units Graph for " + MF.getFunction()->getName() +
":" + BB->getBasicBlock()->getName());
else
ViewGraph(this, "dag." + MF.getFunction()->getName(), false,
"Scheduling-Units Graph for " + MF.getFunction()->getName());
ViewGraph(this, Name, false, Title);
#else
errs() << "ScheduleDAG::viewGraph is only available in debug builds on "
<< "systems with Graphviz or gv!\n";
#endif // NDEBUG
}
/// Out-of-line implementation with no arguments is handy for gdb.
void ScheduleDAG::viewGraph() {
viewGraph(getDAGName(), "Scheduling-Units Graph for " + getDAGName());
}