summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-07-14 01:10:55 +0000
committerChris Lattner <sabre@nondot.org>2005-07-14 01:10:55 +0000
commit51ded0e1eecbbe7ff6d533cb2e5f928efb3cc41c (patch)
tree38f8c0a3a4e2b5fab1c9d205dc154c2c95c8836f /llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
parent8640f2bdc1a805cf22a40c461d145ddb63b13848 (diff)
downloadbcm5719-llvm-51ded0e1eecbbe7ff6d533cb2e5f928efb3cc41c.tar.gz
bcm5719-llvm-51ded0e1eecbbe7ff6d533cb2e5f928efb3cc41c.zip
If the Graphviz program is available, use it to visualize dot graphs.
llvm-svn: 22429
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index d4c1dcd3b8a..8ab6783d561 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/llvm/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");
OpenPOWER on IntegriCloud