[llvm-commits] [llvm] r128568 - /llvm/trunk/include/llvm/PassAnalysisSupport.h
Jakob Stoklund Olesen
stoklund at 2pi.dk
Wed Mar 30 11:32:53 PDT 2011
Author: stoklund
Date: Wed Mar 30 13:32:53 2011
New Revision: 128568
URL: http://llvm.org/viewvc/llvm-project?rev=128568&view=rev
Log:
Don't add the same analysis implementation pair twice.
Prevent infinite growth of the list.
Patch by José Fonseca!
Modified:
llvm/trunk/include/llvm/PassAnalysisSupport.h
Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassAnalysisSupport.h?rev=128568&r1=128567&r2=128568&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassAnalysisSupport.h (original)
+++ llvm/trunk/include/llvm/PassAnalysisSupport.h Wed Mar 30 13:32:53 2011
@@ -142,6 +142,8 @@
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);
}
More information about the llvm-commits
mailing list