From: Jakob Stoklund Olesen Date: Wed, 30 Mar 2011 18:32:53 +0000 (+0000) Subject: Don't add the same analysis implementation pair twice. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b516e00b43b90a7c231bfc8d91c27e860e1b40ea;p=oota-llvm.git Don't add the same analysis implementation pair twice. Prevent infinite growth of the list. Patch by José Fonseca! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128568 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h index a3342d51386..fede1216c3c 100644 --- a/include/llvm/PassAnalysisSupport.h +++ b/include/llvm/PassAnalysisSupport.h @@ -142,6 +142,8 @@ public: Pass *findImplPass(Pass *P, AnalysisID PI, Function &F); void addAnalysisImplsPair(AnalysisID PI, Pass *P) { + if (findImplPass(PI) == P) + return; std::pair pir = std::make_pair(PI,P); AnalysisImpls.push_back(pir); }