[llvm] r258183 - [SCEV] Use range-for; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 19 12:53:46 PST 2016
Author: sanjoy
Date: Tue Jan 19 14:53:46 2016
New Revision: 258183
URL: http://llvm.org/viewvc/llvm-project?rev=258183&view=rev
Log:
[SCEV] Use range-for; NFC
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=258183&r1=258182&r2=258183&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Jan 19 14:53:46 2016
@@ -5248,13 +5248,12 @@ ScalarEvolution::computeExitLimit(const
// lead to the loop header.
bool MustExecuteLoopHeader = true;
BasicBlock *Exit = nullptr;
- for (succ_iterator SI = succ_begin(ExitingBlock), SE = succ_end(ExitingBlock);
- SI != SE; ++SI)
- if (!L->contains(*SI)) {
+ for (auto *SBB : successors(ExitingBlock))
+ if (!L->contains(SBB)) {
if (Exit) // Multiple exit successors.
return getCouldNotCompute();
- Exit = *SI;
- } else if (*SI != L->getHeader()) {
+ Exit = SBB;
+ } else if (SBB != L->getHeader()) {
MustExecuteLoopHeader = false;
}
More information about the llvm-commits
mailing list