diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-16 02:04:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-16 02:04:36 +0000 |
commit | eb265cdc90fa6b515eb87c4c29cd2f1e588a0cda (patch) | |
tree | 3296eef8e21900ba6f5364ded341a8f06f63c076 /lib | |
parent | 96f549310013eaf751ff401b5ad3cbe01542e9b1 (diff) | |
download | external_llvm-eb265cdc90fa6b515eb87c4c29cd2f1e588a0cda.zip external_llvm-eb265cdc90fa6b515eb87c4c29cd2f1e588a0cda.tar.gz external_llvm-eb265cdc90fa6b515eb87c4c29cd2f1e588a0cda.tar.bz2 |
* Print the "return" node in the graphs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4199 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/DataStructure/Printer.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/Analysis/DataStructure/Printer.cpp b/lib/Analysis/DataStructure/Printer.cpp index d8e755b..4235fef 100644 --- a/lib/Analysis/DataStructure/Printer.cpp +++ b/lib/Analysis/DataStructure/Printer.cpp @@ -146,7 +146,7 @@ void DSGraph::print(std::ostream &O) const { O << "\tNode0x1" << "[ plaintext=circle, label =\"" << escapeLabel("returning") << "\"];\n"; writeEdge(O, (void*)1, "", -1, RetNode, "arrowtail=tee,color=gray63"); - } + } // Output all of the call nodes... for (unsigned i = 0, e = FunctionCalls.size(); i != e; ++i) { @@ -194,6 +194,23 @@ struct DOTGraphTraits<DSGraph*> : public DefaultDOTGraphTraits { assert(Node == I.getNode() && "Iterator not for this node!"); return Node->getMergeMapLabel(I.getOffset()); } + + /// addCustomGraphFeatures - Use this graph writing hook to emit call nodes + /// and the return node. + /// + static void addCustomGraphFeatures(DSGraph *G, GraphWriter<DSGraph*> &GW) { + // Output the returned value pointer... + if (G->getRetNode().getNode() != 0) { + // Output the return node... + GW.emitSimpleNode((void*)1, "plaintext=circle", "returning"); + + // Add edge from return node to real destination + int RetEdgeDest = G->getRetNode().getOffset(); + if (RetEdgeDest == 0) RetEdgeDest = -1; + GW.emitEdge((void*)1, -1, G->getRetNode().getNode(), + RetEdgeDest, "arrowtail=tee,color=gray63"); + } + } }; |