summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ScheduleDAGPrinter.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-03-07 00:18:22 +0000
committerAndrew Trick <atrick@apple.com>2012-03-07 00:18:22 +0000
commit56b94c52c9bf0342106ca7d274b9bb469d5ef619 (patch)
tree8142fc1ee1e1404cd0b6961354d97eb3f0e7e3f4 /lib/CodeGen/ScheduleDAGPrinter.cpp
parent8ceaa660bfec72249976c1f411db7f40cbc438bb (diff)
downloadllvm-56b94c52c9bf0342106ca7d274b9bb469d5ef619.tar.gz
llvm-56b94c52c9bf0342106ca7d274b9bb469d5ef619.tar.bz2
llvm-56b94c52c9bf0342106ca7d274b9bb469d5ef619.tar.xz
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
Diffstat (limited to 'lib/CodeGen/ScheduleDAGPrinter.cpp')
-rw-r--r--lib/CodeGen/ScheduleDAGPrinter.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/CodeGen/ScheduleDAGPrinter.cpp b/lib/CodeGen/ScheduleDAGPrinter.cpp
index f2c2f773f2..38feee95a5 100644
--- a/lib/CodeGen/ScheduleDAGPrinter.cpp
+++ b/lib/CodeGen/ScheduleDAGPrinter.cpp
@@ -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());
+}