Skip to content

Commit

Permalink
Pass the graph to the DOTGraphTraits.getEdgeAttributes().
Browse files Browse the repository at this point in the history
This follows the interface of getNodeAttributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126562 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tobiasgrosser committed Feb 27, 2011
1 parent 0aa00f9 commit a91f86c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions include/llvm/Support/DOTGraphTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ struct DefaultDOTGraphTraits {

/// 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 "";
}

Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Support/GraphWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class GraphWriter {

emitEdge(static_cast<const void*>(Node), edgeidx,
static_cast<const void*>(TargetNode), DestPort,
DTraits.getEdgeAttributes(Node, EI));
DTraits.getEdgeAttributes(Node, EI, G));
}
}

Expand Down
3 changes: 2 additions & 1 deletion lib/CodeGen/ScheduleDAGPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
3 changes: 2 additions & 1 deletion lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a91f86c

Please sign in to comment.