Enhancements for --view-graph

llvm-svn: 50737
This commit is contained in:
Mikhail Glushenkov 2008-05-06 17:26:14 +00:00
parent be23113e93
commit ee81aa3812
1 changed files with 21 additions and 7 deletions

View File

@ -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() {