diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-06 17:26:14 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-06 17:26:14 +0000 |
commit | 97fda6d91593b28bcfd8682facfecdaf290f2cb0 (patch) | |
tree | 40290fe40642d181f9e479d62e02dab69fa8a9ad /tools/llvmc2/CompilationGraph.cpp | |
parent | 2ba4c5ababa878b05a7de1e97a98df50d8bcf6c4 (diff) | |
download | external_llvm-97fda6d91593b28bcfd8682facfecdaf290f2cb0.zip external_llvm-97fda6d91593b28bcfd8682facfecdaf290f2cb0.tar.gz external_llvm-97fda6d91593b28bcfd8682facfecdaf290f2cb0.tar.bz2 |
Enhancements for --view-graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc2/CompilationGraph.cpp')
-rw-r--r-- | tools/llvmc2/CompilationGraph.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/tools/llvmc2/CompilationGraph.cpp b/tools/llvmc2/CompilationGraph.cpp index 53195cb..c0c849b 100644 --- a/tools/llvmc2/CompilationGraph.cpp +++ b/tools/llvmc2/CompilationGraph.cpp @@ -204,15 +204,29 @@ namespace llvm { : public DefaultDOTGraphTraits { - template<typename GraphType> - static std::string getNodeLabel(const Node* N, const GraphType&) { - if (N->ToolPtr) - return N->Name(); - else - return "root"; - } + template<typename GraphType> + static std::string getNodeLabel(const Node* N, const GraphType&) + { + if (N->ToolPtr) + if (N->ToolPtr->IsJoin()) + return N->Name() + "\n (join" + + (N->HasChildren() ? ")" + : std::string(": ") + N->ToolPtr->OutputLanguage() + ')'); + else + return N->Name(); + else + return "root"; + } + template<typename EdgeIter> + static std::string getEdgeSourceLabel(const Node* N, EdgeIter I) { + if (N->ToolPtr) + return N->ToolPtr->OutputLanguage(); + else + return I->ToolPtr->InputLanguage(); + } }; + } void CompilationGraph::writeGraph() { |