[llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h
Chris Lattner
lattner at cs.uiuc.edu
Tue Apr 20 16:31:17 PDT 2004
Changes in directory llvm/include/llvm:
CallGraphSCCPass.h updated: 1.3 -> 1.4
---
Log message:
Add the ability for SCC passes to initialize and finalize themselves
---
Diffs of the changes: (+13 -0)
Index: llvm/include/llvm/CallGraphSCCPass.h
diff -u llvm/include/llvm/CallGraphSCCPass.h:1.3 llvm/include/llvm/CallGraphSCCPass.h:1.4
--- llvm/include/llvm/CallGraphSCCPass.h:1.3 Tue Nov 11 16:41:29 2003
+++ llvm/include/llvm/CallGraphSCCPass.h Tue Apr 20 16:29:57 2004
@@ -26,15 +26,28 @@
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
/// 1, where recursive portions of the call graph will have SCC size > 1.
///
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.
More information about the llvm-commits
mailing list