mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-12 07:21:56 +00:00
[PM] Fix an iterator problem spotted by the MSVC debug iterators and
AaronBallman. Thanks for the excellent review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194857 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d515e98ebf
commit
4303b091d0
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user