aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/GraphWriter.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h
index e898733a58..ac0d52379f 100644
--- a/include/llvm/Support/GraphWriter.h
+++ b/include/llvm/Support/GraphWriter.h
@@ -111,9 +111,14 @@ public:
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 @@ public:
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