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 796c74a21ca86d5168cc21e98d469d4e237b433c..3cb8164c3c3dd57c277b804a39c95afa567c598b 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 7573ef0dc9e7a2d64bd6c69902ebed7cd9c6b556..8e1b0f92faa48dc4025dac074a8a2b0ff6d1d7ab 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 027f6150e26b60e944719b542231070bbde987a9..4b55a2284f856048b11a249ae09e4a4c58e3159d 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 76eb9453561e95242562a68c271eb1bf433a1c96..cd1647b17b9b891a9d57598cbbe63a0d346680a8 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)