diff options
author | Chris Lattner <sabre@nondot.org> | 2005-07-14 01:10:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-07-14 01:10:55 +0000 |
commit | f1a2f15ed35c1cf987f6a1a703f855a3c61fdab6 (patch) | |
tree | 8c097638f1479a1bdd27f85e1ef8d40c854fc593 /lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | |
parent | 6fb0d735f0ffdf4cd1b0a1fa04bd436586097448 (diff) |
If the Graphviz program is available, use it to visualize dot graphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22429 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index d4c1dcd3b8..8ab6783d56 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -116,10 +116,19 @@ void SelectionDAG::viewGraph() { F.close(); std::cerr << "\n"; +#ifdef HAVE_GRAPHVIZ + std::cerr << "Running 'Graphviz' program... " << std::flush; + if (system(("Graphviz " + Filename).c_str())) { + std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; + } else { + return; + } +#endif + std::cerr << "Running 'dot' program... " << std::flush; if (system(("dot -Tps -Nfontname=Courier -Gsize=7.5,10 " + Filename + " > /tmp/dag.tempgraph.ps").c_str())) { - std::cerr << "Error running dot: 'dot' not in path?\n"; + std::cerr << "Error viewing graph: 'dot' not in path?\n"; } else { std::cerr << "\n"; system("gv /tmp/dag.tempgraph.ps"); |