From 0b8e076d0bc487dea5c4e08e41319b9414358b2f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 30 Dec 2005 20:00:46 +0000 Subject: [PATCH] Patch #1 of Saem Ghani's Pass Manager refactoring. From the man: "All this should do is create what will eventually be the specialised passmanagers. Currently, the templates are inheriting them, once the template specialisations' methods have been absorbed, patches submitted method by method. I'll nuke the specialisations and have the new objects inherit directly from passmanagert, and sanitise the world of all references to templates. " git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25053 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/PassManagerT.h | 41 ++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h index b679f6ffd5a..2a7be145fa6 100644 --- a/lib/VMCore/PassManagerT.h +++ b/lib/VMCore/PassManagerT.h @@ -175,7 +175,7 @@ class PassManagerT : public PassManagerTraits,public AnalysisResolver{ public: PassManagerT(ParentClass *Par = 0) : Parent(Par), Batcher(0) {} - ~PassManagerT() { + virtual ~PassManagerT() { // Delete all of the contained passes... for (typename std::vector::iterator I = Passes.begin(), E = Passes.end(); I != E; ++I) @@ -623,6 +623,16 @@ public: }; +//===----------------------------------------------------------------------===// +// BasicBlockPassManager +// +// This pass manager is used to group together all of the BasicBlockPass's +// into a single unit. +// +class BasicBlockPassManager { + //TODO:Start absorbing PassManagerTraits +}; + //===----------------------------------------------------------------------===// // PassManagerTraits Specialization @@ -630,7 +640,8 @@ public: // This pass manager is used to group together all of the BasicBlockPass's // into a single unit. // -template<> class PassManagerTraits : public BasicBlockPass { +template<> class PassManagerTraits : public BasicBlockPass, + public BasicBlockPassManager { public: // PassClass - The type of passes tracked by this PassManager typedef BasicBlockPass PassClass; @@ -677,6 +688,16 @@ public: }; +//===----------------------------------------------------------------------===// +// FunctionPassManager +// +// This pass manager is used to group together all of the FunctionPass's +// into a single unit. +// +class FunctionPassManagerT { + //TODO:Start absorbing PassManagerTraits +}; + //===----------------------------------------------------------------------===// // PassManagerTraits Specialization @@ -684,7 +705,8 @@ public: // This pass manager is used to group together all of the FunctionPass's // into a single unit. // -template<> class PassManagerTraits : public FunctionPass { +template<> class PassManagerTraits : public FunctionPass, + public FunctionPassManagerT { public: // PassClass - The type of passes tracked by this PassManager typedef FunctionPass PassClass; @@ -722,13 +744,23 @@ public: }; +//===----------------------------------------------------------------------===// +// ModulePassManager +// +// This is the top level PassManager implementation that holds generic passes. +// +class ModulePassManager { + //TODO:Start absorbing PassManagerTraits +}; + //===----------------------------------------------------------------------===// // PassManagerTraits Specialization // // This is the top level PassManager implementation that holds generic passes. // -template<> class PassManagerTraits : public ModulePass { +template<> class PassManagerTraits : public ModulePass, + public ModulePassManager { public: // PassClass - The type of passes tracked by this PassManager typedef ModulePass PassClass; @@ -757,7 +789,6 @@ public: }; - //===----------------------------------------------------------------------===// // PassManagerTraits Method Implementations // -- 2.34.1