1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[PM] Fix an iterator problem spotted by the MSVC debug iterators and

AaronBallman. Thanks for the excellent review.

llvm-svn: 194857
This commit is contained in:
Chandler Carruth 2013-11-15 21:56:44 +00:00
parent b938b29b37
commit 90456d2ef5

View File

@ -47,11 +47,12 @@ void AnalysisManager::invalidateAll(Function *F) {
FunctionAnalysisResultListT &ResultsList = FunctionAnalysisResultLists[F];
for (FunctionAnalysisResultListT::iterator I = ResultsList.begin(),
E = ResultsList.end();
I != E; ++I)
I != E;)
if (I->second->invalidate(F)) {
FunctionAnalysisResultListT::iterator Old = I--;
InvalidatedPassIDs.push_back(Old->first);
ResultsList.erase(Old);
InvalidatedPassIDs.push_back(I->first);
I = ResultsList.erase(I);
} else {
++I;
}
while (!InvalidatedPassIDs.empty())
FunctionAnalysisResults.erase(
@ -80,11 +81,12 @@ void AnalysisManager::invalidateAll(Module *M) {
FunctionAnalysisResultListT &ResultsList = FI->second;
for (FunctionAnalysisResultListT::iterator I = ResultsList.begin(),
E = ResultsList.end();
I != E; ++I)
I != E;)
if (I->second->invalidate(F)) {
FunctionAnalysisResultListT::iterator Old = I--;
InvalidatedPassIDs.push_back(Old->first);
ResultsList.erase(Old);
InvalidatedPassIDs.push_back(I->first);
I = ResultsList.erase(I);
} else {
++I;
}
while (!InvalidatedPassIDs.empty())
FunctionAnalysisResults.erase(