summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ScheduleDAGPrinter.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-02-11 23:42:39 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-02-11 23:42:39 +0000
commitf412f7c417eb4836ce875b0d214ee91026eba894 (patch)
tree09602be8f93d4155d08909a62f76b8db20fd57ab /lib/CodeGen/ScheduleDAGPrinter.cpp
parentce7f5a1e50fa312ce27e41030dd1b2e02ba8d604 (diff)
downloadllvm-f412f7c417eb4836ce875b0d214ee91026eba894.tar.gz
Apparently some MachineBasicBlock's don't have corresponding llvm basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64340 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ScheduleDAGPrinter.cpp')
-rw-r--r--lib/CodeGen/ScheduleDAGPrinter.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CodeGen/ScheduleDAGPrinter.cpp b/lib/CodeGen/ScheduleDAGPrinter.cpp
index e2ae5a03c133..594c24d11d1e 100644
--- a/lib/CodeGen/ScheduleDAGPrinter.cpp
+++ b/lib/CodeGen/ScheduleDAGPrinter.cpp
@@ -83,9 +83,13 @@ std::string DOTGraphTraits<ScheduleDAG*>::getNodeLabel(const SUnit *SU,
void ScheduleDAG::viewGraph() {
// This code is only for debugging!
#ifndef NDEBUG
- ViewGraph(this, "dag." + MF.getFunction()->getName(),
- "Scheduling-Units Graph for " + MF.getFunction()->getName() + ':' +
- BB->getBasicBlock()->getName());
+ if (BB->getBasicBlock())
+ ViewGraph(this, "dag." + MF.getFunction()->getName(),
+ "Scheduling-Units Graph for " + MF.getFunction()->getName() + ':' +
+ BB->getBasicBlock()->getName());
+ else
+ ViewGraph(this, "dag." + MF.getFunction()->getName(),
+ "Scheduling-Units Graph for " + MF.getFunction()->getName());
#else
cerr << "ScheduleDAG::viewGraph is only available in debug builds on "
<< "systems with Graphviz or gv!\n";