Remove old pass manager.
[oota-llvm.git] / include / llvm / PassAnalysisSupport.h
index 1575d565bbbd677ca34ae43883b601f215378cb5..f591400d272a2decbc25460e93e557c54c66d267 100644 (file)
@@ -175,8 +175,6 @@ struct AnalysisResolver {
 
   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 @@ protected:
 ///
 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,36 +201,15 @@ AnalysisType *Pass::getAnalysisToUpdate() const {
 ///
 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
-  const PassInfo *PI = getClassPassInfo<AnalysisType>();
-  return getAnalysisID<AnalysisType>(PI);
+  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!");
+  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)
   // vector.
@@ -248,7 +218,6 @@ AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const {
           "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,