diff options
author | Chris Lattner <sabre@nondot.org> | 2005-10-01 00:19:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-10-01 00:19:21 +0000 |
commit | f85a55b09657094a1e3954728c7f4ca5bdb6f56a (patch) | |
tree | f8f6700488f243f1fb3e42606372bae18abe6607 /include/llvm | |
parent | 37345fe3cd2dd56c3711592a5af6c294c10c7aba (diff) | |
download | external_llvm-f85a55b09657094a1e3954728c7f4ca5bdb6f56a.zip external_llvm-f85a55b09657094a1e3954728c7f4ca5bdb6f56a.tar.gz external_llvm-f85a55b09657094a1e3954728c7f4ca5bdb6f56a.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Support/GraphWriter.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h index e898733..ac0d523 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 |