aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index 8ab6783d56..fbe6cdb9c5 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -102,6 +102,10 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
/// rendered using 'dot'.
///
void SelectionDAG::viewGraph() {
+// This code is only for debugging!
+#ifdef NDEBUG
+ std::cerr << "SelectionDAG::viewGraph is only available in debug builds!\n";
+#else
std::string Filename = "/tmp/dag." +
getMachineFunction().getFunction()->getName() + ".dot";
std::cerr << "Writing '" << Filename << "'... ";
@@ -134,4 +138,5 @@ void SelectionDAG::viewGraph() {
system("gv /tmp/dag.tempgraph.ps");
}
system(("rm " + Filename + " /tmp/dag.tempgraph.ps").c_str());
+#endif
}