diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-22 05:24:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-22 05:24:46 +0000 |
commit | 3660ecabbb85b31308f38938ce3f56f0a330a84b (patch) | |
tree | 90042a2d539d672a0c932ff0b745c036d8963ada /include | |
parent | 5e664b8f7c5ba877058a3a1cdfcce8e6b7388a6a (diff) | |
download | external_llvm-3660ecabbb85b31308f38938ce3f56f0a330a84b.zip external_llvm-3660ecabbb85b31308f38938ce3f56f0a330a84b.tar.gz external_llvm-3660ecabbb85b31308f38938ce3f56f0a330a84b.tar.bz2 |
eliminate a bunch of dynamic_cast's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/LoopPass.h | 3 | ||||
-rw-r--r-- | include/llvm/Pass.h | 1 | ||||
-rw-r--r-- | include/llvm/PassManagers.h | 6 |
3 files changed, 9 insertions, 1 deletions
diff --git a/include/llvm/Analysis/LoopPass.h b/include/llvm/Analysis/LoopPass.h index 2dceccb..25488da 100644 --- a/include/llvm/Analysis/LoopPass.h +++ b/include/llvm/Analysis/LoopPass.h @@ -94,6 +94,9 @@ public: return "Loop Pass Manager"; } + virtual PMDataManager *getAsPMDataManager() { return this; } + virtual Pass *getAsPass() { return this; } + /// Print passes managed by this manager void dumpPassStructure(unsigned Offset); diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index 0a53cbf..7bc6295 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -153,6 +153,7 @@ public: return this; } virtual ImmutablePass *getAsImmutablePass() { return 0; } + virtual PMDataManager *getAsPMDataManager() { return 0; } /// verifyAnalysis() - This member can be implemented by a analysis pass to /// check state of analysis information. diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h index dffc24a..443a9e0 100644 --- a/include/llvm/PassManagers.h +++ b/include/llvm/PassManagers.h @@ -273,6 +273,8 @@ public: } virtual ~PMDataManager(); + + virtual Pass *getAsPass() = 0; /// Augment AvailableAnalysis by adding analysis made available by pass P. void recordAvailableAnalysis(Pass *P); @@ -413,7 +415,6 @@ private: /// function. class FPPassManager : public ModulePass, public PMDataManager { - public: static char ID; explicit FPPassManager(int Depth) @@ -435,6 +436,9 @@ public: /// bool doFinalization(Module &M); + virtual PMDataManager *getAsPMDataManager() { return this; } + virtual Pass *getAsPass() { return this; } + /// Pass Manager itself does not invalidate any analysis info. void getAnalysisUsage(AnalysisUsage &Info) const { Info.setPreservesAll(); |