aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/Printer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-22 07:13:10 +0000
committerChris Lattner <sabre@nondot.org>2004-06-22 07:13:10 +0000
commit8e667cdc94a922731e71baf7c9ad33e6d40bfb19 (patch)
treed9cf7aaba298074bb5c25ba150aa9f1925117562 /lib/Analysis/DataStructure/Printer.cpp
parent60f5cf42e99d3ab4fb534201f04d99b80ade0957 (diff)
If an edge points to a field of another memory object, actually reflect this
in the DOT visualization of the DSGraphs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Printer.cpp')
-rw-r--r--lib/Analysis/DataStructure/Printer.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Analysis/DataStructure/Printer.cpp b/lib/Analysis/DataStructure/Printer.cpp
index f6e073adce..9863875a4e 100644
--- a/lib/Analysis/DataStructure/Printer.cpp
+++ b/lib/Analysis/DataStructure/Printer.cpp
@@ -100,6 +100,24 @@ struct DOTGraphTraits<const DSGraph*> : public DefaultDOTGraphTraits {
static std::string getNodeAttributes(const DSNode *N) {
return "shape=Mrecord";
}
+
+ static bool edgeTargetsEdgeSource(const void *Node,
+ DSNode::const_iterator I) {
+ unsigned O = I.getNode()->getLink(I.getOffset()).getOffset();
+ return (O >> DS::PointerShift) != 0;
+ }
+
+ static DSNode::const_iterator getEdgeTarget(const DSNode *Node,
+ DSNode::const_iterator I) {
+ unsigned O = I.getNode()->getLink(I.getOffset()).getOffset();
+ unsigned LinkNo = O >> DS::PointerShift;
+ const DSNode *N = *I;
+ DSNode::const_iterator R = N->begin();
+ for (; LinkNo; --LinkNo)
+ ++R;
+ return R;
+ }
+
/// addCustomGraphFeatures - Use this graph writing hook to emit call nodes
/// and the return node.