diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-11-20 17:39:12 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-05-14 11:43:32 +0000 |
commit | 5e801ac66d24704442eba426ed13c3effb8a34e7 (patch) | |
tree | fbacd59e1bd2f5ae75d5717a1274b95f12ac1c22 /contrib/llvm-project/llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 349cc55c9796c4596a5b9904cd3281af295f878f (diff) | |
parent | 846a2208a8ab099f595fe7e8b2e6d54a7b5e67fb (diff) |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Transforms/Utils/LoopUtils.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/contrib/llvm-project/llvm/lib/Transforms/Utils/LoopUtils.cpp b/contrib/llvm-project/llvm/lib/Transforms/Utils/LoopUtils.cpp index f0f079335683..68572d479742 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -663,9 +663,8 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE, // about ordering because we already dropped the references. // NOTE: This iteration is safe because erasing the block does not remove // its entry from the loop's block list. We do that in the next section. - for (Loop::block_iterator LpI = L->block_begin(), LpE = L->block_end(); - LpI != LpE; ++LpI) - (*LpI)->eraseFromParent(); + for (BasicBlock *BB : L->blocks()) + BB->eraseFromParent(); // Finally, the blocks from loopinfo. This has to happen late because // otherwise our loop iterators won't work. @@ -1501,10 +1500,9 @@ Loop *llvm::cloneLoop(Loop *L, Loop *PL, ValueToValueMapTy &VM, LPM->addLoop(New); // Add all of the blocks in L to the new loop. - for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); - I != E; ++I) - if (LI->getLoopFor(*I) == L) - New.addBasicBlockToLoop(cast<BasicBlock>(VM[*I]), *LI); + for (BasicBlock *BB : L->blocks()) + if (LI->getLoopFor(BB) == L) + New.addBasicBlockToLoop(cast<BasicBlock>(VM[BB]), *LI); // Add all of the subloops to the new loop. for (Loop *I : *L) |