Introduce a new technique for merging BasicBlock with Instruction sentinel by superpo...
[oota-llvm.git] / lib / CodeGen / ScheduleDAGPrinter.cpp
index b5d030c1b8108c0b589ae328a81ddc1f2cfa51d5..594c24d11d1ee499e4a4cd65e6b06d8f0094c536 100644 (file)
@@ -34,7 +34,7 @@ namespace llvm {
   template<>
   struct DOTGraphTraits<ScheduleDAG*> : public DefaultDOTGraphTraits {
     static std::string getGraphName(const ScheduleDAG *G) {
-      return G->MF->getFunction()->getName();
+      return G->MF.getFunction()->getName();
     }
 
     static bool renderGraphFromBottomUp() {
@@ -48,9 +48,9 @@ namespace llvm {
     
     /// If you want to override the dot attributes printed for a particular
     /// edge, override this method.
-    template<typename EdgeIter>
-    static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
-      if (EI.isSpecialDep())
+    static std::string getEdgeAttributes(const SUnit *Node,
+                                         SUnitIterator EI) {
+      if (EI.isArtificialDep())
         return "color=cyan,style=dashed";
       if (EI.isCtrlDep())
         return "color=blue,style=dashed";
@@ -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";