From 8f232764316cefbe30e45d3e19c387e20312292b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 2 Sep 2009 04:34:06 +0000 Subject: one more try at making this simpler, hopefully it won't break everything :) llvm-svn: 80759 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp') diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp index d21e0316828..25964b2cd8c 100644 --- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -178,11 +178,11 @@ void CGPassManager::RefreshCallGraph(std::vector &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; } -- cgit v1.2.3