[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jul 13 22:33:24 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGPrinter.cpp updated: 1.14 -> 1.15
---
Log message:

Make this use the new autoconf support for finding the executables for
gv and Graphviz.


---
Diffs of the changes:  (+8 -5)

 SelectionDAGPrinter.cpp |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.14 llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.15
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.14	Thu Jul 14 00:17:43 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp	Thu Jul 14 00:33:13 2005
@@ -103,9 +103,7 @@
 ///
 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 @@
 
 #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";
 }






More information about the llvm-commits mailing list