Author: lattner
Date: Sat Feb  2 20:05:04 2008
New Revision: 46672

URL: http://llvm.org/viewvc/llvm-project?rev=46672&view=rev
Log:
add a -view-legalize-types-dags option, for viewing the dags going into 
legalize types.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=46672&r1=46671&r2=46672&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Sat Feb  2 20:05:04 
2008
@@ -16,9 +16,20 @@
 #include "LegalizeTypes.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/MathExtras.h"
 using namespace llvm;
 
+#ifndef NDEBUG
+static cl::opt<bool>
+ViewLegalizeTypesDAGs("view-legalize-types-dags", cl::Hidden,
+                cl::desc("Pop up a window to show dags before legalize 
types"));
+#else
+static const bool ViewLegalizeTypesDAGs = 0;
+#endif
+
+
+
 /// run - This is the main entry point for the type legalizer.  This does a
 /// top-down traversal of the dag, legalizing types as it goes.
 void DAGTypeLegalizer::run() {
@@ -438,5 +449,7 @@
 /// Note that this is an involved process that may invalidate pointers into
 /// the graph.
 void SelectionDAG::LegalizeTypes() {
+  if (ViewLegalizeTypesDAGs) viewGraph();
+  
   DAGTypeLegalizer(*this).run();
 }


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to