summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-09-02 03:48:41 +0000
committerDuncan Sands <baldrick@free.fr>2009-09-02 03:48:41 +0000
commit5632d96176ac0d60b2d80d909b9b639554bb0d61 (patch)
tree76422670065f413f57514287453768f87c220ac0 /llvm/lib/Analysis
parentad5a600a24a74392fad5ade9236b62dca64f2df1 (diff)
downloadbcm5719-llvm-5632d96176ac0d60b2d80d909b9b639554bb0d61.tar.gz
bcm5719-llvm-5632d96176ac0d60b2d80d909b9b639554bb0d61.zip
Complicate Chris's simplification, avoiding complaints
about singular iterators when building with expensive checks turned on. llvm-svn: 80757
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
index 85f22c7bd42..d21e0316828 100644
--- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -161,7 +161,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.
- for (CallGraphNode::iterator I = CGN->begin(), E = CGN->end(); I != 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 ||
@@ -178,7 +178,11 @@ void CGPassManager::RefreshCallGraph(std::vector<CallGraphNode*> &CurSCC,
"CallGraphSCCPass did not update the CallGraph correctly!");
// Just remove the edge from the set of callees.
+ bool wasLast = I + 1 == E;
CGN->removeCallEdge(I);
+ if (wasLast)
+ // I is now a singular iterator, do not compare with E.
+ break;
E = CGN->end();
continue;
}
OpenPOWER on IntegriCloud