From: Davide Italiano Date: Wed, 13 May 2015 19:51:21 +0000 (+0000) Subject: [LoopIdiomRecognize] Use auto + range-based loop. NFC intended. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=89614e19a201f203e2c6967ec53e579e07a9ce28;hp=1826197dbda5c76eccdec9029f7854e5ed57e6d8 [LoopIdiomRecognize] Use auto + range-based loop. NFC intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237284 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index b57b7c276d7..9bc0153bf51 100644 --- a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -639,13 +639,12 @@ bool LoopIdiomRecognize::runOnCountableLoop() { bool MadeChange = false; // Scan all the blocks in the loop that are not in subloops. - for (Loop::block_iterator BI = CurLoop->block_begin(), - E = CurLoop->block_end(); BI != E; ++BI) { + for (auto BB : CurLoop->getBlocks()) { // Ignore blocks in subloops. - if (LI.getLoopFor(*BI) != CurLoop) + if (LI.getLoopFor(BB) != CurLoop) continue; - MadeChange |= runOnLoopBlock(*BI, BECount, ExitBlocks); + MadeChange |= runOnLoopBlock(BB, BECount, ExitBlocks); } return MadeChange; }