mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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
This commit is contained in:
parent
03ef449917
commit
b516e00b43
@ -142,6 +142,8 @@ public:
|
|||||||
Pass *findImplPass(Pass *P, AnalysisID PI, Function &F);
|
Pass *findImplPass(Pass *P, AnalysisID PI, Function &F);
|
||||||
|
|
||||||
void addAnalysisImplsPair(AnalysisID PI, Pass *P) {
|
void addAnalysisImplsPair(AnalysisID PI, Pass *P) {
|
||||||
|
if (findImplPass(PI) == P)
|
||||||
|
return;
|
||||||
std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P);
|
std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P);
|
||||||
AnalysisImpls.push_back(pir);
|
AnalysisImpls.push_back(pir);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user