diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index 3b4cb287f83..a94aaa4aaa7 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -127,7 +127,7 @@ void SelectionDAG::viewGraph() { system(("rm " + Filename).c_str()); return; } -#endif +#endif // HAVE_GRAPHVIZ #ifdef HAVE_GV std::cerr << "Running 'dot' program... " << std::flush; @@ -140,9 +140,12 @@ void SelectionDAG::viewGraph() { } system(("rm " + Filename + " /tmp/dag.tempgraph.ps").c_str()); return; -#endif -#endif +#endif // HAVE_GV +#endif // NDEBUG std::cerr << "SelectionDAG::viewGraph is only available in debug builds on " << "systems with Graphviz or gv!\n"; + +#ifndef NDEBUG system(("rm " + Filename).c_str()); +#endif }