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

Chris Lattner lattner at cs.uiuc.edu
Tue Jan 11 19:41:36 PST 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.11 -> 1.12
---
Log message:

Add an option to view the selection dags as they are generated.


---
Diffs of the changes:  (+11 -0)

Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.11 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.12
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.11	Tue Jan 11 16:03:46 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Tue Jan 11 21:41:21 2005
@@ -28,11 +28,20 @@
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetLowering.h"
 #include "llvm/Target/TargetMachine.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include <map>
 #include <iostream>
 using namespace llvm;
 
+#ifndef _NDEBUG
+static cl::opt<bool>
+ViewDAGs("view-isel-dags", cl::Hidden,
+         cl::desc("Pop up a window to show isel dags as they are selected"));
+#else
+static const bool ViewDAGS = 0;
+#endif
+
 namespace llvm {
   //===--------------------------------------------------------------------===//
   /// FunctionLoweringInfo - This contains information that is global to a
@@ -890,6 +899,8 @@
   // the code to the MachineBasicBlock.
   InstructionSelectBasicBlock(DAG);
 
+  if (ViewDAGs) DAG.viewGraph();
+
   DEBUG(std::cerr << "Selected machine code:\n");
   DEBUG(BB->dump());
 






More information about the llvm-commits mailing list