[LVI] Avoid iterator invalidation in LazyValueInfoCache::threadEdge

Do that by copying out the elements to another SmallPtrSet.
Follow up from r245309.

llvm-svn: 245590
This commit is contained in:
Bruno Cardoso Lopes 2015-08-20 18:24:54 +00:00
parent baf90fc265
commit ed6b9bfeab
1 changed files with 1 additions and 1 deletions

View File

@ -1055,7 +1055,7 @@ void LazyValueInfoCache::threadEdge(BasicBlock *PredBB, BasicBlock *OldSucc,
auto I = OverDefinedCache.find(OldSucc);
if (I == OverDefinedCache.end())
return; // Nothing to process here.
SmallPtrSetImpl<Value *> &ClearSet = I->second;
SmallPtrSet<Value *, 4> ClearSet(I->second.begin(), I->second.end());
// Use a worklist to perform a depth-first search of OldSucc's successors.
// NOTE: We do not need a visited list since any blocks we have already