[llvm-commits] CVS: llvm/include/llvm/PassManager.h

Devang Patel dpatel at apple.com
Tue Nov 7 13:50:05 PST 2006



Changes in directory llvm/include/llvm:

PassManager.h updated: 1.16 -> 1.17
---
Log message:

Add FunctionPassManager_New.


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

 PassManager.h |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+)


Index: llvm/include/llvm/PassManager.h
diff -u llvm/include/llvm/PassManager.h:1.16 llvm/include/llvm/PassManager.h:1.17
--- llvm/include/llvm/PassManager.h:1.16	Tue Nov  7 15:31:57 2006
+++ llvm/include/llvm/PassManager.h	Tue Nov  7 15:49:50 2006
@@ -108,6 +108,41 @@
   std::vector<Pass *> PassVector;
 };
 
+/// FunctionPassManager_New manages FunctionPasses and BasicBlockPassManagers.
+/// It batches all function passes and basic block pass managers together and
+/// sequence them to process one function at a time before processing next
+/// function.
+class FunctionPassManager_New:public Pass {
+public:
+  FunctionPassManager_New(ModuleProvider *P) { /* TODO */ }
+  FunctionPassManager_New() { 
+    activeBBPassManager = NULL;
+  }
+  ~FunctionPassManager_New() { /* TODO */ };
+ 
+  /// add - Add a pass to the queue of passes to run.  This passes
+  /// ownership of the Pass to the PassManager.  When the
+  /// PassManager_X is destroyed, the pass will be destroyed as well, so
+  /// there is no need to delete the pass. (TODO delete passes.)
+  /// This implies that all passes MUST be allocated with 'new'.
+  void add(Pass *P) { /* TODO*/  }
+
+  /// Add pass into the pass manager queue.
+  bool addPass(Pass *P);
+
+  /// Execute all of the passes scheduled for execution.  Keep
+  /// track of whether any of the passes modifies the function, and if
+  /// so, return true.
+  bool runOnModule(Module &M);
+
+private:
+  // Collection of pass that are not yet scheduled
+  std::vector<Pass *> PassVector;
+ 
+  // Active Pass Managers
+  BasicBlockPassManager_New *activeBBPassManager;
+};
+
 } // End llvm namespace
 
 #endif






More information about the llvm-commits mailing list