[llvm-commits] CVS: llvm/include/llvm/Support/GraphWriter.h
Chris Lattner
lattner at cs.uiuc.edu
Fri Sep 30 17:19:32 PDT 2005
Changes in directory llvm/include/llvm/Support:
GraphWriter.h updated: 1.25 -> 1.26
---
Log message:
Annotate nodes with their addresses if a graph requests it.
This is Jim's feature implemented so that graphs could 'opt-in' and get
this behavior. This is currently used by selection dags.
---
Diffs of the changes: (+13 -2)
GraphWriter.h | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
Index: llvm/include/llvm/Support/GraphWriter.h
diff -u llvm/include/llvm/Support/GraphWriter.h:1.25 llvm/include/llvm/Support/GraphWriter.h:1.26
--- llvm/include/llvm/Support/GraphWriter.h:1.25 Fri Sep 30 14:33:41 2005
+++ llvm/include/llvm/Support/GraphWriter.h Fri Sep 30 19:19:21 2005
@@ -111,9 +111,14 @@
if (!NodeAttributes.empty()) O << NodeAttributes << ",";
O << "label=\"{";
- if (!DOTTraits::renderGraphFromBottomUp())
+ if (!DOTTraits::renderGraphFromBottomUp()) {
O << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
+ // If we should include the address of the node in the label, do so now.
+ if (DOTTraits::hasNodeAddressLabel(Node, G))
+ O << "|" << (void*)Node;
+ }
+
// Print out the fields of the current node...
child_iterator EI = GTraits::child_begin(Node);
child_iterator EE = GTraits::child_end(Node);
@@ -131,9 +136,15 @@
O << "}";
if (DOTTraits::renderGraphFromBottomUp()) O << "|";
}
- if (DOTTraits::renderGraphFromBottomUp())
+
+ if (DOTTraits::renderGraphFromBottomUp()) {
O << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
+ // If we should include the address of the node in the label, do so now.
+ if (DOTTraits::hasNodeAddressLabel(Node, G))
+ O << "|" << (void*)Node;
+ }
+
O << "}\"];\n"; // Finish printing the "node" line
// Output all of the edges now
More information about the llvm-commits
mailing list