Add loop info verification mechanism.
[oota-llvm.git] / include / llvm / Analysis / LoopPass.h
index 07b9c572ce0baade1cbd80c3cabe3ae7aa156812..7a820ccc5dac0015d3a9e650ffd1e9f614f79f47 100644 (file)
@@ -29,6 +29,8 @@ class Function;
 class LoopPass : public Pass {
 
  public:
+ LoopPass(intptr_t pid) : Pass(pid) {}
+
   // runOnLoop - THis method should be implemented by the subclass to perform
   // whatever action is necessary for the specfied Loop. 
   virtual bool runOnLoop (Loop *L, LPPassManager &LPM) = 0;
@@ -55,13 +57,18 @@ class LoopPass : public Pass {
 
   /// Assign pass manager to manager this pass
   virtual void assignPassManager(PMStack &PMS,
-                                PassManagerType PMT = PMT_LoopPassManager);
+                                 PassManagerType PMT = PMT_LoopPassManager);
 
+  ///  Return what kind of Pass Manager can manage this pass.
+  virtual PassManagerType getPotentialPassManagerType() const {
+    return PMT_LoopPassManager;
+  }
 };
 
 class LPPassManager : public FunctionPass, public PMDataManager {
 
 public:
+  static char ID;
   LPPassManager(int Depth);
 
   /// run - Execute all of the passes scheduled for execution.  Keep track of
@@ -107,6 +114,11 @@ public:
   // queue. This allows LoopPass to change loop nest for the loop. This
   // utility may send LPPassManager into infinite loops so use caution.
   void redoLoop(Loop *L);
+
+private:
+  /// verifyLoopInfo - Verify loop nest.
+  void verifyLoopInfo();
+
 private:
   std::deque<Loop *> LQ;
   bool skipThisLoop;