diff options
author | Devang Patel <dpatel@apple.com> | 2006-11-07 22:23:34 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2006-11-07 22:23:34 +0000 |
commit | b30803bc17a5be655b7c4ef356e75ae5524b0931 (patch) | |
tree | 6f8a5c92aabf48544ddbb1ebdf29fa599b986b44 /include/llvm/PassManager.h | |
parent | 4d23a2fa10a38962133adb30c978042e07a594b5 (diff) | |
download | llvm-b30803bc17a5be655b7c4ef356e75ae5524b0931.tar.gz llvm-b30803bc17a5be655b7c4ef356e75ae5524b0931.tar.bz2 llvm-b30803bc17a5be655b7c4ef356e75ae5524b0931.tar.xz |
Add PassManager_New.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31521 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassManager.h')
-rw-r--r-- | include/llvm/PassManager.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/llvm/PassManager.h b/include/llvm/PassManager.h index 0bcf318f5d..7e1d903d55 100644 --- a/include/llvm/PassManager.h +++ b/include/llvm/PassManager.h @@ -166,6 +166,40 @@ private: FunctionPassManager_New *activeFunctionPassManager; }; +/// PassManager_New manages ModulePassManagers +class PassManager_New: public Pass { + +public: + + /// add - Add a pass to the queue of passes to run. This passes ownership of + /// the Pass to the PassManager. When the PassManager is destroyed, the pass + /// will be destroyed as well, so there is no need to delete the pass. This + /// implies that all passes MUST be allocated with 'new'. + void add(Pass *P); + + /// run - Execute all of the passes scheduled for execution. Keep track of + /// whether any of the passes modifies the module, and if so, return true. + bool run(Module &M); + +private: + + /// Add a pass into a passmanager queue. This is used by schedulePasses + bool addPass(Pass *p); + + /// Schedule all passes collected in pass queue using add(). Add all the + /// schedule passes into various manager's queue using addPass(). + void schedulePasses(); + + // Collection of pass managers + std::vector<ModulePassManager_New *> PassManagers; + + // Collection of pass that are not yet scheduled + std::vector<Pass *> PassVector; + + // Active Pass Manager + ModulePassManager_New *activeManager; +}; + } // End llvm namespace #endif |