mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-05 03:36:43 +00:00
simpler solution to iterator invalidation "problem" found
by expensive checking. llvm-svn: 80695
This commit is contained in:
parent
2c2c37b2b1
commit
341df26dd9
@ -145,12 +145,7 @@ void CGPassManager::RefreshCallGraph(std::vector<CallGraphNode*> &CurSCC,
|
||||
// CGN with those actually in the function.
|
||||
|
||||
// Get the set of call sites currently in the function.
|
||||
bool isLast = CGN->empty();
|
||||
for (CallGraphNode::iterator I = CGN->begin(), E = CGN->end(), N; !isLast;){
|
||||
// Take care not to use singular iterators.
|
||||
N = I + 1;
|
||||
isLast = N == E;
|
||||
|
||||
for (CallGraphNode::iterator I = CGN->begin(), E = CGN->end(); I != E; ){
|
||||
// If this call site is null, then the function pass deleted the call
|
||||
// entirely and the WeakVH nulled it out.
|
||||
if (I->first == 0 ||
|
||||
@ -172,7 +167,7 @@ void CGPassManager::RefreshCallGraph(std::vector<CallGraphNode*> &CurSCC,
|
||||
assert(!CallSites.count(I->first) &&
|
||||
"Call site occurs in node multiple times");
|
||||
CallSites.insert(std::make_pair(I->first, I->second));
|
||||
I = N;
|
||||
++I;
|
||||
}
|
||||
|
||||
// Loop over all of the instructions in the function, getting the callsites.
|
||||
|
Loading…
x
Reference in New Issue
Block a user