summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-20 18:06:09 +0000
committerChris Lattner <sabre@nondot.org>2006-10-20 18:06:09 +0000
commit34ab4d45d2aa11bee666836e3571be2627959a42 (patch)
tree5fc5d90a531b2ed38cdff3a1cdb24c31b1daa33c /lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
parent986cc38613e7859ab6c9ab8aa9fc2e686f8c2ab4 (diff)
downloadllvm-34ab4d45d2aa11bee666836e3571be2627959a42.tar.gz
llvm-34ab4d45d2aa11bee666836e3571be2627959a42.tar.bz2
llvm-34ab4d45d2aa11bee666836e3571be2627959a42.tar.xz
Make flag and chain edges visually distinguishable from value edges in DOT
output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31067 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index f68c227dc0..2c392d9d64 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -41,6 +41,20 @@ namespace llvm {
const SelectionDAG *Graph) {
return true;
}
+
+ /// 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) {
+ SDOperand Op = EI.getNode()->getOperand(EI.getOperand());
+ MVT::ValueType VT = Op.getValueType();
+ if (VT == MVT::Flag)
+ return "color=red,style=bold";
+ else if (VT == MVT::Other)
+ return "style=dashed";
+ return "";
+ }
+
static std::string getNodeLabel(const SDNode *Node,
const SelectionDAG *Graph);
@@ -114,7 +128,8 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
Op += LBB->getName();
//Op += " " + (const void*)BBDN->getBasicBlock();
} else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(Node)) {
- if (G && R->getReg() != 0 && MRegisterInfo::isPhysicalRegister(R->getReg())) {
+ if (G && R->getReg() != 0 &&
+ MRegisterInfo::isPhysicalRegister(R->getReg())) {
Op = Op + " " + G->getTarget().getRegisterInfo()->getName(R->getReg());
} else {
Op += " #" + utostr(R->getReg());