Start removing the use of an ad-hoc 'never inline' set and instead
[oota-llvm.git] / include / llvm / PassAnalysisSupport.h
index a99a1ae8711818bdd20dbcf4565823c24a0741a1..5c6a2d7a92f9638c0118f03f1274071ceb82a288 100644 (file)
@@ -143,6 +143,8 @@ public:
   Pass *findImplPass(Pass *P, AnalysisID PI, Function &F);
 
   void addAnalysisImplsPair(AnalysisID PI, Pass *P) {
+    if (findImplPass(PI) == P)
+      return;
     std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P);
     AnalysisImpls.push_back(pir);
   }
@@ -156,11 +158,11 @@ public:
   // getAnalysisIfAvailable - Return analysis result or null if it doesn't exist
   Pass *getAnalysisIfAvailable(AnalysisID ID, bool Direction) const;
 
+private:
   // AnalysisImpls - This keeps track of which passes implements the interfaces
   // that are required by the current pass (to implement getAnalysis()).
   std::vector<std::pair<AnalysisID, Pass*> > AnalysisImpls;
 
-private:
   // PassManager that is used to resolve analysis info
   PMDataManager &PM;
 };