From b5c875d574c4aee115f1977d1ebbad18866b3601 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Wed, 30 Mar 2011 18:32:53 +0000 Subject: [PATCH] Don't add the same analysis implementation pair twice. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevent infinite growth of the list. Patch by José Fonseca! llvm-svn: 128568 --- include/llvm/PassAnalysisSupport.h | 2 ++ 1 file changed, 2 insertions(+) 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); }