aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-26 19:10:28 +0000
committerChris Lattner <sabre@nondot.org>2003-02-26 19:10:28 +0000
commitd2c0b28c33ccf7a219f0adfcd348615493fb8e91 (patch)
treee64142724d06c033f989780ce79799191ede6927
parentdcc0ac9eb790bd3c09ed9fcc03a6294161b41236 (diff)
* Un "protect" the getAnalysis<> functions
* Add a new initializePass() method to ImmutablePass git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5629 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Pass.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h
index 6242a4c81e..7138fadef5 100644
--- a/include/llvm/Pass.h
+++ b/include/llvm/Pass.h
@@ -142,8 +142,6 @@ public:
return dynamic_cast<AnalysisType*>(Resolver->getAnalysisToUpdate(PI));
}
-protected:
-
/// getAnalysis<AnalysisType>() - This function is used by subclasses to get
/// to the analysis information that they claim to use by overriding the
/// getAnalysisUsage function.
@@ -203,8 +201,16 @@ inline std::ostream &operator<<(std::ostream &OS, const Pass &P) {
/// "basic" versions of AnalysisGroups.
///
struct ImmutablePass : public Pass {
+ /// initializePass - This method may be overriden by immutable passes to allow
+ /// them to perform various initialization actions they require. This is
+ /// primarily because an ImmutablePass can "require" another ImmutablePass,
+ /// and if it does, the overloaded version of initializePass may get access to
+ /// these passes with getAnalysis<>.
+ ///
+ virtual void initializePass() {}
- // ImmutablePasses are never run.
+ /// ImmutablePasses are never run.
+ ///
virtual bool run(Module &M) { return false; }
private: