diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-20 21:30:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-20 21:30:06 +0000 |
commit | a10df5028211fc897751d23e91d035db47d23fac (patch) | |
tree | b517b8b12003fdcd1ddd2af08b6817c25e0ae608 /include/llvm/CallGraphSCCPass.h | |
parent | c99acc3709f789baaf75b4ab3e1907b0226d620b (diff) |
Add the ability for SCC passes to initialize and finalize themselves
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CallGraphSCCPass.h')
-rw-r--r-- | include/llvm/CallGraphSCCPass.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/CallGraphSCCPass.h b/include/llvm/CallGraphSCCPass.h index 86cdc29f57..73c9323074 100644 --- a/include/llvm/CallGraphSCCPass.h +++ b/include/llvm/CallGraphSCCPass.h @@ -26,9 +26,16 @@ namespace llvm { class CallGraphNode; +class Module; struct CallGraphSCCPass : public Pass { + /// doInitialization - This method is called before the SCC's of the program + /// has been processed, allowing the pass to do initialization as necessary. + virtual bool doInitialization(Module &M) { + return false; + } + /// runOnSCC - This method should be implemented by the subclass to perform /// whatever action is necessary for the specified SCC. Note that /// non-recursive (or only self-recursive) functions will have an SCC size of @@ -36,6 +43,12 @@ struct CallGraphSCCPass : public Pass { /// virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC) = 0; + /// doFinalization - This method is called after the SCC's of the program has + /// been processed, allowing the pass to do final cleanup as necessary. + virtual bool doFinalization(Module &M) { + return false; + } + /// run - Run this pass, returning true if a modification was made to the /// module argument. This is implemented in terms of the runOnSCC method. /// |