summaryrefslogtreecommitdiff
path: root/include/llvm/PassManager.h
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-08-12 17:22:39 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-08-12 17:22:39 +0000
commit8ab1ef265a6547ab13c10a26c994610bd3ad9d9e (patch)
treed7918240cc1a0fb35cca4aec6e72e356b6d17c62 /include/llvm/PassManager.h
parent20a3be3ba832947d1dc5e6b26ae68335a7914aff (diff)
downloadllvm-8ab1ef265a6547ab13c10a26c994610bd3ad9d9e.tar.gz
llvm-8ab1ef265a6547ab13c10a26c994610bd3ad9d9e.tar.bz2
llvm-8ab1ef265a6547ab13c10a26c994610bd3ad9d9e.tar.xz
Add FunctionPassManager - it's like a PassManager, but it only deals in
FunctionPasses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassManager.h')
-rw-r--r--include/llvm/PassManager.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/llvm/PassManager.h b/include/llvm/PassManager.h
index f67d9da1a3..5a313d5a6f 100644
--- a/include/llvm/PassManager.h
+++ b/include/llvm/PassManager.h
@@ -28,9 +28,33 @@ public:
void add(Pass *P);
/// run - Execute all of the passes scheduled for execution. Keep track of
- /// whether any of the functions modifies the program, and if so, return true.
+ /// whether any of the passes modifies the module, and if so, return true.
///
bool run(Module &M);
};
+class FunctionPass;
+class Function;
+
+class FunctionPassManager {
+ PassManagerT<Function> *PM; // This is a straightforward Pimpl class
+public:
+ FunctionPassManager();
+ ~FunctionPassManager();
+
+ /// add - Add a pass to the queue of passes to run. This passes
+ /// ownership of the FunctionPass 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(FunctionPass *P);
+
+ /// run - 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 run(Function &M);
+};
+
#endif