aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-30 18:32:53 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-30 18:32:53 +0000
commitb516e00b43b90a7c231bfc8d91c27e860e1b40ea (patch)
tree61661deb92fbbfa50ab3a35def6a0bd70b32449a
parent03ef44991768b803ed5b210877ce0d83bf16fd93 (diff)
downloadexternal_llvm-b516e00b43b90a7c231bfc8d91c27e860e1b40ea.zip
external_llvm-b516e00b43b90a7c231bfc8d91c27e860e1b40ea.tar.gz
external_llvm-b516e00b43b90a7c231bfc8d91c27e860e1b40ea.tar.bz2
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
-rw-r--r--include/llvm/PassAnalysisSupport.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h
index a3342d5..fede121 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<AnalysisID, Pass*> pir = std::make_pair(PI,P);
AnalysisImpls.push_back(pir);
}