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
This commit is contained in:
Chris Lattner 2006-10-20 18:06:09 +00:00
parent 986cc38613
commit 34ab4d45d2

View File

@ -42,6 +42,20 @@ namespace llvm {
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);
static std::string getNodeAttributes(const SDNode *N,
@ -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());