aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/GraphWriter.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-11 00:24:59 +0000
committerChris Lattner <sabre@nondot.org>2005-01-11 00:24:59 +0000
commit89a1ed58399045d2b2c7b246571945b068f2e5e1 (patch)
tree7e373648c81e474f885cf115214d16876eda760e /include/llvm/Support/GraphWriter.h
parentfc08d9c789b6698fe5f5904d573bb03fcc52a32d (diff)
Add support for bottom-up graphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/GraphWriter.h')
-rw-r--r--include/llvm/Support/GraphWriter.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h
index 02f3952422..ffbf066c46 100644
--- a/include/llvm/Support/GraphWriter.h
+++ b/include/llvm/Support/GraphWriter.h
@@ -78,6 +78,9 @@ public:
else
O << "digraph " << Name << " {\n";
+ if (DOTTraits::renderGraphFromBottomUp())
+ O << "\trankdir=\"BT\";\n";
+
std::string GraphName = DOTTraits::getGraphName(G);
if (!GraphName.empty())
O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n";
@@ -106,14 +109,17 @@ public:
O << "\tNode" << reinterpret_cast<const void*>(Node) << " [shape=record,";
if (!NodeAttributes.empty()) O << NodeAttributes << ",";
- O << "label=\"{"
- << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
+ O << "label=\"{";
+
+ if (!DOTTraits::renderGraphFromBottomUp())
+ O << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
// Print out the fields of the current node...
child_iterator EI = GTraits::child_begin(Node);
child_iterator EE = GTraits::child_end(Node);
if (EI != EE) {
- O << "|{";
+ if (!DOTTraits::renderGraphFromBottomUp()) O << "|";
+ O << "{";
for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i) {
if (i) O << "|";
@@ -123,7 +129,11 @@ public:
if (EI != EE)
O << "|<g64>truncated...";
O << "}";
+ if (DOTTraits::renderGraphFromBottomUp()) O << "|";
}
+ if (DOTTraits::renderGraphFromBottomUp())
+ O << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
+
O << "}\"];\n"; // Finish printing the "node" line
// Output all of the edges now