[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Printer.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Jun 22 02:21:01 PDT 2004


Changes in directory llvm/lib/Analysis/DataStructure:

Printer.cpp updated: 1.68 -> 1.69

---
Log message:

If an edge points to a field of another memory object, actually reflect this
in the DOT visualization of the DSGraphs.


---
Diffs of the changes:  (+18 -0)

Index: llvm/lib/Analysis/DataStructure/Printer.cpp
diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.68 llvm/lib/Analysis/DataStructure/Printer.cpp:1.69
--- llvm/lib/Analysis/DataStructure/Printer.cpp:1.68	Wed May  5 01:10:06 2004
+++ llvm/lib/Analysis/DataStructure/Printer.cpp	Tue Jun 22 02:13:10 2004
@@ -100,6 +100,24 @@
   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.





More information about the llvm-commits mailing list