summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commitc5ab6ce6135a178149ef1ce5d88a28161a8e1d90 (patch)
tree9632d8f31f5fff1bb64e6e77247a0112f958485e /llvm/lib
parent819cb9ad6133bfb2e31582c0b1e56bd6d6916da3 (diff)
downloadbcm5719-llvm-c5ab6ce6135a178149ef1ce5d88a28161a8e1d90.tar.gz
bcm5719-llvm-c5ab6ce6135a178149ef1ce5d88a28161a8e1d90.zip
Make flag and chain edges visually distinguishable from value edges in DOT
output. llvm-svn: 31067
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index f68c227dc0c..2c392d9d64d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud