Optimize Thumb2 jumptable to use tbb / tbh when all the offsets fit in byte / halfword.
[oota-llvm.git] / lib / CodeGen / ScheduleDAGPrinter.cpp
index 2f0e662c6bd41215bbbbcbf15feac31fd78f8aa8..ae358ec4fb5beef56000f9a11ef5dd698edae004 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,8 +48,8 @@ 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) {
+    static std::string getEdgeAttributes(const SUnit *Node,
+                                         SUnitIterator EI) {
       if (EI.isArtificialDep())
         return "color=cyan,style=dashed";
       if (EI.isCtrlDep())
@@ -59,7 +59,8 @@ namespace llvm {
     
 
     static std::string getNodeLabel(const SUnit *Node,
-                                    const ScheduleDAG *Graph);
+                                    const ScheduleDAG *Graph,
+                                    bool ShortNames);
     static std::string getNodeAttributes(const SUnit *N,
                                          const ScheduleDAG *Graph) {
       return "shape=Mrecord";
@@ -73,7 +74,8 @@ namespace llvm {
 }
 
 std::string DOTGraphTraits<ScheduleDAG*>::getNodeLabel(const SUnit *SU,
-                                                       const ScheduleDAG *G) {
+                                                       const ScheduleDAG *G,
+                                                       bool ShortNames) {
   return G->getGraphNodeLabel(SU);
 }
 
@@ -83,9 +85,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()->getNameStr(), false,
+              "Scheduling-Units Graph for " + MF.getFunction()->getNameStr() + 
+              ":" + BB->getBasicBlock()->getNameStr());
+  else
+    ViewGraph(this, "dag." + MF.getFunction()->getNameStr(), false,
+              "Scheduling-Units Graph for " + MF.getFunction()->getNameStr());
 #else
   cerr << "ScheduleDAG::viewGraph is only available in debug builds on "
        << "systems with Graphviz or gv!\n";