[llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h

Chris Lattner lattner at cs.uiuc.edu
Fri Dec 30 12:00:57 PST 2005



Changes in directory llvm/lib/VMCore:

PassManagerT.h updated: 1.57 -> 1.58
---
Log message:

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.
"


---
Diffs of the changes:  (+36 -5)

 PassManagerT.h |   41 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 36 insertions(+), 5 deletions(-)


Index: llvm/lib/VMCore/PassManagerT.h
diff -u llvm/lib/VMCore/PassManagerT.h:1.57 llvm/lib/VMCore/PassManagerT.h:1.58
--- llvm/lib/VMCore/PassManagerT.h:1.57	Thu Apr 21 18:46:51 2005
+++ llvm/lib/VMCore/PassManagerT.h	Fri Dec 30 14:00:46 2005
@@ -175,7 +175,7 @@
 
 public:
   PassManagerT(ParentClass *Par = 0) : Parent(Par), Batcher(0) {}
-  ~PassManagerT() {
+  virtual ~PassManagerT() {
     // Delete all of the contained passes...
     for (typename std::vector<PassClass*>::iterator
            I = Passes.begin(), E = Passes.end(); I != E; ++I)
@@ -623,6 +623,16 @@
 };
 
 
+//===----------------------------------------------------------------------===//
+// BasicBlockPassManager
+//
+// This pass manager is used to group together all of the BasicBlockPass's
+// into a single unit.
+//
+class BasicBlockPassManager {
+  //TODO:Start absorbing PassManagerTraits<BasicBlock>
+};
+
 
 //===----------------------------------------------------------------------===//
 // PassManagerTraits<BasicBlock> Specialization
@@ -630,7 +640,8 @@
 // This pass manager is used to group together all of the BasicBlockPass's
 // into a single unit.
 //
-template<> class PassManagerTraits<BasicBlock> : public BasicBlockPass {
+template<> class PassManagerTraits<BasicBlock> : public BasicBlockPass,
+                                                 public BasicBlockPassManager {
 public:
   // PassClass - The type of passes tracked by this PassManager
   typedef BasicBlockPass PassClass;
@@ -677,6 +688,16 @@
 };
 
 
+//===----------------------------------------------------------------------===//
+// FunctionPassManager
+//
+// This pass manager is used to group together all of the FunctionPass's
+// into a single unit.
+//
+class FunctionPassManagerT {
+  //TODO:Start absorbing PassManagerTraits<Function>
+};
+
 
 //===----------------------------------------------------------------------===//
 // PassManagerTraits<Function> Specialization
@@ -684,7 +705,8 @@
 // This pass manager is used to group together all of the FunctionPass's
 // into a single unit.
 //
-template<> class PassManagerTraits<Function> : public FunctionPass {
+template<> class PassManagerTraits<Function> : public FunctionPass, 
+                                               public FunctionPassManagerT {
 public:
   // PassClass - The type of passes tracked by this PassManager
   typedef FunctionPass PassClass;
@@ -722,13 +744,23 @@
 };
 
 
+//===----------------------------------------------------------------------===//
+// ModulePassManager
+//
+// This is the top level PassManager implementation that holds generic passes.
+//
+class ModulePassManager {
+  //TODO:Start absorbing PassManagerTraits<Module>
+};
+
 
 //===----------------------------------------------------------------------===//
 // PassManagerTraits<Module> Specialization
 //
 // This is the top level PassManager implementation that holds generic passes.
 //
-template<> class PassManagerTraits<Module> : public ModulePass {
+template<> class PassManagerTraits<Module> : public ModulePass, 
+                                             public ModulePassManager {
 public:
   // PassClass - The type of passes tracked by this PassManager
   typedef ModulePass PassClass;
@@ -757,7 +789,6 @@
 };
 
 
-
 //===----------------------------------------------------------------------===//
 // PassManagerTraits Method Implementations
 //






More information about the llvm-commits mailing list