[llvm-commits] [llvm] r50737 - /llvm/trunk/tools/llvmc2/CompilationGraph.cpp
Mikhail Glushenkov
foldr at codedgers.com
Tue May 6 10:26:14 PDT 2008
Author: foldr
Date: Tue May 6 12:26:14 2008
New Revision: 50737
URL: http://llvm.org/viewvc/llvm-project?rev=50737&view=rev
Log:
Enhancements for --view-graph
Modified:
llvm/trunk/tools/llvmc2/CompilationGraph.cpp
Modified: llvm/trunk/tools/llvmc2/CompilationGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/CompilationGraph.cpp?rev=50737&r1=50736&r2=50737&view=diff
==============================================================================
--- llvm/trunk/tools/llvmc2/CompilationGraph.cpp (original)
+++ llvm/trunk/tools/llvmc2/CompilationGraph.cpp Tue May 6 12:26:14 2008
@@ -204,15 +204,29 @@
: 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() {
More information about the llvm-commits
mailing list