Add RegionPass support.
[oota-llvm.git] / include / llvm / Pass.h
index 70d692d507b7db35ee5e7977a16a7505fb6888af..ed0fb39f5d6cdbe42a5687697f16420670a59a17 100644 (file)
@@ -57,6 +57,7 @@ enum PassManagerType {
   PMT_CallGraphPassManager,  ///< CGPassManager
   PMT_FunctionPassManager,   ///< FPPassManager
   PMT_LoopPassManager,       ///< LPPassManager
+  PMT_RegionPassManager,     ///< RGPassManager
   PMT_BasicBlockPassManager, ///< BBPassManager
   PMT_Last
 };
@@ -64,13 +65,14 @@ enum PassManagerType {
 // Different types of passes.
 enum PassKind {
   PT_BasicBlock,
+  PT_Region,
   PT_Loop,
   PT_Function,
   PT_CallGraphSCC,
   PT_Module,
   PT_PassManager
 };
-  
+
 //===----------------------------------------------------------------------===//
 /// Pass interface - Implemented by all 'passes'.  Subclass this if you are an
 /// interprocedural optimization or you do not fit into any of the more
@@ -119,7 +121,7 @@ public:
   /// Each pass is responsible for assigning a pass manager to itself.
   /// PMS is the stack of available pass manager. 
   virtual void assignPassManager(PMStack &, 
-                                 PassManagerType = PMT_Unknown) {}
+                                 PassManagerType) {}
   /// Check if available pass managers are suitable for this pass or not.
   virtual void preparePassManager(PMStack &);
   
@@ -225,7 +227,7 @@ public:
   virtual bool runOnModule(Module &M) = 0;
 
   virtual void assignPassManager(PMStack &PMS, 
-                                 PassManagerType T = PMT_ModulePassManager);
+                                 PassManagerType T);
 
   ///  Return what kind of Pass Manager can manage this pass.
   virtual PassManagerType getPotentialPassManagerType() const;
@@ -295,19 +297,8 @@ public:
   ///
   virtual bool doFinalization(Module &);
 
-  /// runOnModule - On a module, we run this pass by initializing,
-  /// ronOnFunction'ing once for every function in the module, then by
-  /// finalizing.
-  ///
-  virtual bool runOnModule(Module &M);
-
-  /// run - On a function, we simply initialize, run the function, then
-  /// finalize.
-  ///
-  bool run(Function &F);
-
   virtual void assignPassManager(PMStack &PMS, 
-                                 PassManagerType T = PMT_FunctionPassManager);
+                                 PassManagerType T);
 
   ///  Return what kind of Pass Manager can manage this pass.
   virtual PassManagerType getPotentialPassManagerType() const;
@@ -357,14 +348,8 @@ public:
   ///
   virtual bool doFinalization(Module &);
 
-
-  // To run this pass on a function, we simply call runOnBasicBlock once for
-  // each function.
-  //
-  bool runOnFunction(Function &F);
-
   virtual void assignPassManager(PMStack &PMS, 
-                                 PassManagerType T = PMT_BasicBlockPassManager);
+                                 PassManagerType T);
 
   ///  Return what kind of Pass Manager can manage this pass.
   virtual PassManagerType getPotentialPassManagerType() const;