summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-07-14 05:33:13 +0000
committerChris Lattner <sabre@nondot.org>2005-07-14 05:33:13 +0000
commit46524e2573ab75a94bc37e735caa298b1fbcdc47 (patch)
tree320706aa67a0536411ff3a4fa0563073f95cecd8 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
parentf284268ba5f5a45cb4ecc77d2ce26a177fb27727 (diff)
downloadbcm5719-llvm-46524e2573ab75a94bc37e735caa298b1fbcdc47.tar.gz
bcm5719-llvm-46524e2573ab75a94bc37e735caa298b1fbcdc47.zip
Make this use the new autoconf support for finding the executables for
gv and Graphviz. llvm-svn: 22434
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index fbe6cdb9c55..3e685f34538 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -103,9 +103,7 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
///
void SelectionDAG::viewGraph() {
// This code is only for debugging!
-#ifdef NDEBUG
- std::cerr << "SelectionDAG::viewGraph is only available in debug builds!\n";
-#else
+#ifndef NDEBUG
std::string Filename = "/tmp/dag." +
getMachineFunction().getFunction()->getName() + ".dot";
std::cerr << "Writing '" << Filename << "'... ";
@@ -122,21 +120,26 @@ void SelectionDAG::viewGraph() {
#ifdef HAVE_GRAPHVIZ
std::cerr << "Running 'Graphviz' program... " << std::flush;
- if (system(("Graphviz " + Filename).c_str())) {
+ if (system((LLVM_PATH_GRAPHVIZ " " + Filename).c_str())) {
std::cerr << "Error viewing graph: 'Graphviz' not in path?\n";
} else {
return;
}
#endif
+#ifdef HAVE_GV
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 viewing graph: 'dot' not in path?\n";
} else {
std::cerr << "\n";
- system("gv /tmp/dag.tempgraph.ps");
+ system(LLVM_PATH_GV " /tmp/dag.tempgraph.ps");
}
system(("rm " + Filename + " /tmp/dag.tempgraph.ps").c_str());
+ return;
#endif
+#endif
+ std::cerr << "SelectionDAG::viewGraph is only available in debug builds on "
+ << "systems with Graphviz or gv!\n";
}
OpenPOWER on IntegriCloud