Add support for other GraphViz display tools. This can help

with very large graphs, where dot isn't necessarily the 
most visually pleasing way of looking at the graph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75144 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Greene
2009-07-09 17:06:18 +00:00
parent 354b5ac161
commit 00ad26ff57
4 changed files with 126 additions and 9 deletions

View File

@@ -67,7 +67,17 @@ namespace DOT { // Private functions...
}
}
void DisplayGraph(const sys::Path& Filename, bool wait=true);
namespace GraphProgram {
enum Name {
DOT,
FDP,
NEATO,
TWOPI,
CIRCO
};
}
void DisplayGraph(const sys::Path& Filename, bool wait=true, GraphProgram::Name program = GraphProgram::DOT);
template<typename GraphType>
class GraphWriter {
@@ -314,14 +324,15 @@ template<typename GraphType>
void ViewGraph(const GraphType& G,
const std::string& Name,
bool ShortNames = false,
const std::string& Title = "") {
const std::string& Title = "",
GraphProgram::Name Program = GraphProgram::DOT) {
sys::Path Filename = WriteGraph(G, Name, ShortNames, Title);
if (Filename.isEmpty()) {
return;
}
DisplayGraph(Filename);
DisplayGraph(Filename, true, Program);
}
} // End llvm namespace