From 3660ecabbb85b31308f38938ce3f56f0a330a84b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 22 Jan 2010 05:24:46 +0000 Subject: eliminate a bunch of dynamic_cast's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94155 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/LoopPass.h | 3 +++ include/llvm/Pass.h | 1 + include/llvm/PassManagers.h | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'include') 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(); -- cgit v1.1