From 6f6abfd94baa8420a9d53c86c282c37175401f35 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 11 Feb 2009 23:42:39 +0000 Subject: Apparently some MachineBasicBlock's don't have corresponding llvm basic blocks. llvm-svn: 64340 --- llvm/lib/CodeGen/ScheduleDAGPrinter.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/ScheduleDAGPrinter.cpp') diff --git a/llvm/lib/CodeGen/ScheduleDAGPrinter.cpp b/llvm/lib/CodeGen/ScheduleDAGPrinter.cpp index e2ae5a03c13..594c24d11d1 100644 --- a/llvm/lib/CodeGen/ScheduleDAGPrinter.cpp +++ b/llvm/lib/CodeGen/ScheduleDAGPrinter.cpp @@ -83,9 +83,13 @@ std::string DOTGraphTraits::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"; -- cgit v1.2.3