diff options
author | Chris Lattner <sabre@nondot.org> | 2004-06-22 07:13:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-06-22 07:13:10 +0000 |
commit | 881d959fd48d56e8c5717a1baaed0e17cae57916 (patch) | |
tree | 4ff7fc71f14cc82462c1090769a6450178031a54 /llvm/lib/Analysis/DataStructure/Printer.cpp | |
parent | 70d53125db8ee63aeab6fb56863eea8e609fd697 (diff) | |
download | bcm5719-llvm-881d959fd48d56e8c5717a1baaed0e17cae57916.tar.gz bcm5719-llvm-881d959fd48d56e8c5717a1baaed0e17cae57916.zip |
If an edge points to a field of another memory object, actually reflect this
in the DOT visualization of the DSGraphs.
llvm-svn: 14316
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Printer.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Printer.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Printer.cpp b/llvm/lib/Analysis/DataStructure/Printer.cpp index f6e073adce9..9863875a4e9 100644 --- a/llvm/lib/Analysis/DataStructure/Printer.cpp +++ b/llvm/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. |