diff options
author | Owen Anderson <resistor@mac.com> | 2012-11-15 00:14:15 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2012-11-15 00:14:15 +0000 |
commit | 40b6fdb81e12b40dd41c9f9f07befb60ec7291c3 (patch) | |
tree | 467a798d5e6f1847a8bb536c5678b1b50f1ed973 /include/llvm/Pass.h | |
parent | 3427f0aa7ca6979c8646a9b18c1bdab41dcb6eb0 (diff) | |
download | llvm-40b6fdb81e12b40dd41c9f9f07befb60ec7291c3.tar.gz llvm-40b6fdb81e12b40dd41c9f9f07befb60ec7291c3.tar.bz2 llvm-40b6fdb81e12b40dd41c9f9f07befb60ec7291c3.tar.xz |
Add doInitialization and doFinalization methods to ModulePass's, to allow them to be re-initialized and reused on multiple Module's.
Patch by Pedro Artigas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Pass.h')
-rw-r--r-- | include/llvm/Pass.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index cd651db1f1..4f701d85ca 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -227,10 +227,20 @@ public: /// createPrinterPass - Get a module printer pass. Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; + /// doInitialization - Virtual method overridden by subclasses to do + /// any necessary initialization. + /// + virtual bool doInitialization(void) { return false; } + /// runOnModule - Virtual method overriden by subclasses to process the module /// being operated on. virtual bool runOnModule(Module &M) = 0; + /// doFinalization - Virtual method overriden by subclasses to do any post + /// processing needed after all passes have run. + /// + virtual bool doFinalization(void) { return false; } + virtual void assignPassManager(PMStack &PMS, PassManagerType T); |