aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA/CallGraphSCCPass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r--lib/Analysis/IPA/CallGraphSCCPass.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp
index d21e031682..25964b2cd8 100644
--- a/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -178,11 +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;
+
+ // If we removed the last edge, get out of the loop.
+ if (CGN->empty()) break;
+
E = CGN->end();
continue;
}