diff options
author | David Greene <greened@obbligato.org> | 2009-07-09 17:06:18 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2009-07-09 17:06:18 +0000 |
commit | 00ad26ff5760ff2d1b24acb18718e63541088923 (patch) | |
tree | f54e1d9a35767638a1bab8a43d014e583d998a8e /lib/Support/GraphWriter.cpp | |
parent | 354b5ac1610424a5fa56735425a43b8a475f5980 (diff) |
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
Diffstat (limited to 'lib/Support/GraphWriter.cpp')
-rw-r--r-- | lib/Support/GraphWriter.cpp | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/lib/Support/GraphWriter.cpp b/lib/Support/GraphWriter.cpp index 80458865f5..d0be7a180c 100644 --- a/lib/Support/GraphWriter.cpp +++ b/lib/Support/GraphWriter.cpp @@ -18,7 +18,8 @@ #include "llvm/Config/config.h" using namespace llvm; -void llvm::DisplayGraph(const sys::Path &Filename, bool wait) { +void llvm::DisplayGraph(const sys::Path &Filename, bool wait, + GraphProgram::Name program) { std::string ErrMsg; #if HAVE_GRAPHVIZ sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); @@ -35,15 +36,56 @@ void llvm::DisplayGraph(const sys::Path &Filename, bool wait) { else { Filename.eraseFromDisk(); } - -#elif (HAVE_GV && (HAVE_DOT || HAVE_FDP)) + +#elif (HAVE_GV && (HAVE_DOT || HAVE_FDP || HAVE_NEATO || \ + HAVE_TWOPI || HAVE_CIRCO)) sys::Path PSFilename = Filename; PSFilename.appendSuffix("ps"); + sys::Path prog; + + // Set default grapher +#if HAVE_CIRCO + prog = sys::Path(LLVM_PATH_CIRCO); +#endif +#if HAVE_TWOPI + prog = sys::Path(LLVM_PATH_TWOPI); +#endif +#if HAVE_NEATO + prog = sys::Path(LLVM_PATH_NEATO); +#endif #if HAVE_FDP - sys::Path prog(LLVM_PATH_FDP); -#else - sys::Path prog(LLVM_PATH_DOT); + prog = sys::Path(LLVM_PATH_FDP); +#endif +#if HAVE_DOT + prog = sys::Path(LLVM_PATH_DOT); +#endif + + // Find which program the user wants +#if HAVE_DOT + if (program == GraphProgram::DOT) { + prog = sys::Path(LLVM_PATH_DOT); + } +#endif +#if (HAVE_FDP) + if (program == GraphProgram::FDP) { + prog = sys::Path(LLVM_PATH_FDP); + } +#endif +#if (HAVE_NEATO) + if (program == GraphProgram::NEATO) { + prog = sys::Path(LLVM_PATH_NEATO); + } +#endif +#if (HAVE_TWOPI) + if (program == GraphProgram::TWOPI) { + prog = sys::Path(LLVM_PATH_TWOPI); + } +#endif +#if (HAVE_CIRCO) + if (program == GraphProgram::CIRCO) { + prog = sys::Path(LLVM_PATH_CIRCO); + } #endif std::vector<const char*> args; |