[llvm-commits] CVS: llvm/include/llvm/Pass.h PassAnalysisSupport.h PassManager.h

Devang Patel dpatel at apple.com
Fri Jan 5 12:16:42 PST 2007



Changes in directory llvm/include/llvm:

Pass.h updated: 1.68 -> 1.69
PassAnalysisSupport.h updated: 1.26 -> 1.27
PassManager.h updated: 1.37 -> 1.38
---
Log message:

Remove old pass manager.


---
Diffs of the changes:  (+4 -139)

 Pass.h                |   39 ----------------------------
 PassAnalysisSupport.h |   36 ++------------------------
 PassManager.h         |   68 --------------------------------------------------
 3 files changed, 4 insertions(+), 139 deletions(-)


Index: llvm/include/llvm/Pass.h
diff -u llvm/include/llvm/Pass.h:1.68 llvm/include/llvm/Pass.h:1.69
--- llvm/include/llvm/Pass.h:1.68	Wed Jan  3 19:27:03 2007
+++ llvm/include/llvm/Pass.h	Fri Jan  5 14:16:23 2007
@@ -36,9 +36,6 @@
 #include <typeinfo>
 #include <cassert>
 
-//Use new Pass Manager. Disable old Pass Manager.
-//#define USE_OLD_PASSMANAGER 1
-
 namespace llvm {
 
 class Value;
@@ -52,7 +49,6 @@
 class BasicBlockPassManager;
 class FunctionPassManagerT;
 class ModulePassManager;
-struct AnalysisResolver;
 class AnalysisResolver_New;
 
 // AnalysisID - Use the PassInfo to identify a pass...
@@ -64,8 +60,6 @@
 /// constrained passes described below.
 ///
 class Pass {
-  friend struct AnalysisResolver;
-  AnalysisResolver *Resolver;  // AnalysisResolver this pass is owned by...
   AnalysisResolver_New *Resolver_New;  // Used to resolve analysis
   const PassInfo *PassInfoCache;
 
@@ -77,7 +71,7 @@
   void operator=(const Pass&);  // DO NOT IMPLEMENT
   Pass(const Pass &);           // DO NOT IMPLEMENT
 public:
-  Pass() : Resolver(0), Resolver_New(0), PassInfoCache(0) {}
+  Pass() : Resolver_New(0), PassInfoCache(0) {}
   virtual ~Pass() {} // Destructor is virtual so we can be subclassed
 
   /// getPassName - Return a nice clean name for a pass.  This usually
@@ -204,12 +198,8 @@
   virtual bool runPass(Module &M) { return runOnModule(M); }
   virtual bool runPass(BasicBlock&) { return false; }
 
-#ifdef USE_OLD_PASSMANAGER
-  virtual void addToPassManager(ModulePassManager *PM, AnalysisUsage &AU);
-#else
   // Force out-of-line virtual method.
   virtual ~ModulePass();
-#endif
 };
 
 
@@ -232,15 +222,8 @@
   ///
   virtual bool runOnModule(Module &M) { return false; }
 
-#ifdef USE_OLD_PASSMANAGER
-private:
-  template<typename Trait> friend class PassManagerT;
-  friend class ModulePassManager;
-  virtual void addToPassManager(ModulePassManager *PM, AnalysisUsage &AU);
-#else
   // Force out-of-line virtual method.
   virtual ~ImmutablePass();
-#endif
 };
 
 //===----------------------------------------------------------------------===//
@@ -280,15 +263,6 @@
   ///
   bool run(Function &F);
 
-#ifdef USE_OLD_PASSMANAGER
-protected:
-  template<typename Trait> friend class PassManagerT;
-  friend class ModulePassManager;
-  friend class FunctionPassManagerT;
-  friend class BasicBlockPassManager;
-  virtual void addToPassManager(ModulePassManager *PM, AnalysisUsage &AU);
-  virtual void addToPassManager(FunctionPassManagerT *PM, AnalysisUsage &AU);
-#endif
 };
 
 
@@ -342,17 +316,6 @@
   virtual bool runPass(Module &M) { return false; }
   virtual bool runPass(BasicBlock &BB);
 
-#ifdef USE_OLD_PASSMANAGER
-private:
-  template<typename Trait> friend class PassManagerT;
-  friend class FunctionPassManagerT;
-  friend class BasicBlockPassManager;
-  virtual void addToPassManager(ModulePassManager *PM, AnalysisUsage &AU) {
-    FunctionPass::addToPassManager(PM, AU);
-  }
-  virtual void addToPassManager(FunctionPassManagerT *PM, AnalysisUsage &AU);
-  virtual void addToPassManager(BasicBlockPassManager *PM,AnalysisUsage &AU);
-#endif
 };
 
 /// If the user specifies the -time-passes argument on an LLVM tool command line


Index: llvm/include/llvm/PassAnalysisSupport.h
diff -u llvm/include/llvm/PassAnalysisSupport.h:1.26 llvm/include/llvm/PassAnalysisSupport.h:1.27
--- llvm/include/llvm/PassAnalysisSupport.h:1.26	Wed Dec 13 15:55:30 2006
+++ llvm/include/llvm/PassAnalysisSupport.h	Fri Jan  5 14:16:23 2007
@@ -175,8 +175,6 @@
 
   void startPass(Pass *P) {}
   void endPass(Pass *P) {}
-protected:
-  void setAnalysisResolver(Pass *P, AnalysisResolver *AR);
 };
 
 /// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses
@@ -189,19 +187,12 @@
 ///
 template<typename AnalysisType>
 AnalysisType *Pass::getAnalysisToUpdate() const {
-#ifdef USE_OLD_PASSMANAGER
-  assert(Resolver && "Pass not resident in a PassManager object!");
-#else
   assert(Resolver_New && "Pass not resident in a PassManager object!");
-#endif
+
   const PassInfo *PI = getClassPassInfo<AnalysisType>();
   if (PI == 0) return 0;
-#ifdef USE_OLD_PASSMANAGER
-  return dynamic_cast<AnalysisType*>(Resolver->getAnalysisToUpdate(PI));
-#else
   return dynamic_cast<AnalysisType*>
     (Resolver_New->getAnalysisToUpdate(PI, true));
-#endif
 }
 
 /// getAnalysis<AnalysisType>() - This function is used by subclasses to get
@@ -210,34 +201,14 @@
 ///
 template<typename AnalysisType>
 AnalysisType &Pass::getAnalysis() const {
-#ifdef USE_OLD_PASSMANAGER
-  assert(Resolver && "Pass has not been inserted into a PassManager object!");
-#else
-  assert(Resolver_New&&"Pass has not been inserted into a PassManager object!");
-#endif
+  assert(Resolver_New &&"Pass has not been inserted into a PassManager object!");
+
   return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>());
 }
 
 template<typename AnalysisType>
 AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const {
   assert(PI && "getAnalysis for unregistered pass!");
-#ifdef USE_OLD_PASSMANAGER
-  assert(Resolver && "Pass has not been inserted into a PassManager object!");
-  
-  // PI *must* appear in AnalysisImpls.  Because the number of passes used
-  // should be a small number, we just do a linear search over a (dense)
-  // vector.
-  Pass *ResultPass = 0;
-  for (unsigned i = 0; ; ++i) {
-    assert(i != AnalysisImpls.size() &&
-           "getAnalysis*() called on an analysis that was not "
-           "'required' by pass!");
-    if (AnalysisImpls[i].first == PI) {
-      ResultPass = AnalysisImpls[i].second;
-      break;
-    }
-  }
-#else
   assert(Resolver_New&&"Pass has not been inserted into a PassManager object!");
   // PI *must* appear in AnalysisImpls.  Because the number of passes used
   // should be a small number, we just do a linear search over a (dense)
@@ -247,7 +218,6 @@
           "getAnalysis*() called on an analysis that was not "
           "'required' by pass!");
 
-#endif
   // Because the AnalysisType may not be a subclass of pass (for
   // AnalysisGroups), we must use dynamic_cast here to potentially adjust the
   // return pointer (because the class may multiply inherit, once from pass,


Index: llvm/include/llvm/PassManager.h
diff -u llvm/include/llvm/PassManager.h:1.37 llvm/include/llvm/PassManager.h:1.38
--- llvm/include/llvm/PassManager.h:1.37	Tue Dec 19 13:46:59 2006
+++ llvm/include/llvm/PassManager.h	Fri Jan  5 14:16:23 2007
@@ -26,72 +26,6 @@
 class Module;
 class ModuleProvider;
 
-#ifdef USE_OLD_PASSMANAGER
-
-class ModulePassManager;
-class FunctionPassManagerT;
-class BasicBlockPassManager;
-
-class PassManager {
-  ModulePassManager *PM;    // This is a straightforward Pimpl class
-public:
-  PassManager();
-  ~PassManager();
-
-  /// add - Add a pass to the queue of passes to run.  This passes ownership of
-  /// the Pass to the PassManager.  When the PassManager is destroyed, the pass
-  /// will be destroyed as well, so there is no need to delete the pass.  This
-  /// implies that all passes MUST be allocated with 'new'.
-  ///
-  void add(Pass *P);
-
-  /// run - Execute all of the passes scheduled for execution.  Keep track of
-  /// whether any of the passes modifies the module, and if so, return true.
-  ///
-  bool run(Module &M);
-};
-
-class FunctionPass;
-class ImmutablePass;
-class Function;
-
-class FunctionPassManager {
-  FunctionPassManagerT *PM;    // This is a straightforward Pimpl class
-  ModuleProvider *MP;
-public:
-  FunctionPassManager(ModuleProvider *P);
-  ~FunctionPassManager();
-
-  /// add - Add a pass to the queue of passes to run.  This passes
-  /// ownership of the FunctionPass to the PassManager.  When the
-  /// PassManager is destroyed, the pass will be destroyed as well, so
-  /// there is no need to delete the pass.  This implies that all
-  /// passes MUST be allocated with 'new'.
-  ///
-  void add(FunctionPass *P);
-
-  /// add - ImmutablePasses are not FunctionPasses, so we have a
-  /// special hack to get them into a FunctionPassManager.
-  ///
-  void add(ImmutablePass *IP);
-
-  /// doInitialization - Run all of the initializers for the function passes.
-  ///
-  bool doInitialization();
-  
-  /// run - Execute all of the passes scheduled for execution.  Keep
-  /// track of whether any of the passes modifies the function, and if
-  /// so, return true.
-  ///
-  bool run(Function &F);
-  
-  /// doFinalization - Run all of the initializers for the function passes.
-  ///
-  bool doFinalization();
-};
-
-#else
-
 class ModulePassManager;
 class PassManagerImpl;
 class FunctionPassManagerImpl;
@@ -155,8 +89,6 @@
   ModuleProvider *MP;
 };
 
-#endif
-
 } // End llvm namespace
 
 #endif






More information about the llvm-commits mailing list