Apparently some MachineBasicBlock's don't have corresponding llvm basic blocks.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 11 Feb 2009 23:42:39 +0000 (23:42 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 11 Feb 2009 23:42:39 +0000 (23:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64340 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ScheduleDAGPrinter.cpp

index e2ae5a03c133d760fef52941df452df23886c60c..594c24d11d1ee499e4a4cd65e6b06d8f0094c536 100644 (file)
@@ -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";