OSDN Git Service

Pass the graph to the DOTGraphTraits.getEdgeAttributes().
authorTobias Grosser <grosser@fim.uni-passau.de>
Sun, 27 Feb 2011 04:11:03 +0000 (04:11 +0000)
committerTobias Grosser <grosser@fim.uni-passau.de>
Sun, 27 Feb 2011 04:11:03 +0000 (04:11 +0000)
This follows the interface of getNodeAttributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126562 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/DOTGraphTraits.h
include/llvm/Support/GraphWriter.h
lib/CodeGen/ScheduleDAGPrinter.cpp
lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp

index 796c74a..3cb8164 100644 (file)
@@ -89,8 +89,9 @@ public:
 
   /// 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) {
+  template<typename EdgeIter, typename GraphType>
+  static std::string getEdgeAttributes(const void *Node, EdgeIter EI,
+                                       const GraphType& Graph) {
     return "";
   }
 
index 7573ef0..8e1b0f9 100644 (file)
@@ -240,7 +240,7 @@ public:
 
       emitEdge(static_cast<const void*>(Node), edgeidx,
                static_cast<const void*>(TargetNode), DestPort,
-               DTraits.getEdgeAttributes(Node, EI));
+               DTraits.getEdgeAttributes(Node, EI, G));
     }
   }
 
index 027f615..4b55a22 100644 (file)
@@ -51,7 +51,8 @@ namespace llvm {
     /// If you want to override the dot attributes printed for a particular
     /// edge, override this method.
     static std::string getEdgeAttributes(const SUnit *Node,
-                                         SUnitIterator EI) {
+                                         SUnitIterator EI,
+                                         const ScheduleDAG *Graph) {
       if (EI.isArtificialDep())
         return "color=cyan,style=dashed";
       if (EI.isCtrlDep())
index 76eb945..cd1647b 100644 (file)
@@ -90,7 +90,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 void *Node, EdgeIter EI,
+                                         const SelectionDAG *Graph) {
       SDValue Op = EI.getNode()->getOperand(EI.getOperand());
       EVT VT = Op.getValueType();
       if (VT == MVT::Glue)