aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-06-26 12:28:59 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-06-26 12:28:59 +0000
commit135f735af149e305635ba3886065b493d5c2bf8c (patch)
treeefc8ab49d69279615e3d0a3563a7d05354270bf5 /llvm/lib/Transforms/Scalar/LoopDeletion.cpp
parentff976c99c79d7a00f1c836a57c3e7499316553c4 (diff)
downloadllvm-135f735af149e305635ba3886065b493d5c2bf8c.zip
llvm-135f735af149e305635ba3886065b493d5c2bf8c.tar.gz
llvm-135f735af149e305635ba3886065b493d5c2bf8c.tar.bz2
Apply clang-tidy's modernize-loop-convert to most of lib/Transforms.
Only minor manual fixes. No functionality change intended. llvm-svn: 273808
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopDeletion.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopDeletion.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
index 2e07f34..daf0eb9d 100644
--- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
@@ -115,9 +115,8 @@ bool LoopDeletion::isLoopDead(Loop *L, ScalarEvolution &SE,
// information to identify readonly and readnone calls.
for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
LI != LE; ++LI) {
- for (BasicBlock::iterator BI = (*LI)->begin(), BE = (*LI)->end();
- BI != BE; ++BI) {
- if (BI->mayHaveSideEffects())
+ for (Instruction &I : **LI) {
+ if (I.mayHaveSideEffects())
return false;
}
}
@@ -217,9 +216,8 @@ bool LoopDeletion::runOnLoop(Loop *L, LPPassManager &) {
// Move all of the block's children to be children of the preheader, which
// allows us to remove the domtree entry for the block.
ChildNodes.insert(ChildNodes.begin(), DT[*LI]->begin(), DT[*LI]->end());
- for (SmallVectorImpl<DomTreeNode *>::iterator DI = ChildNodes.begin(),
- DE = ChildNodes.end(); DI != DE; ++DI) {
- DT.changeImmediateDominator(*DI, DT[preheader]);
+ for (DomTreeNode *ChildNode : ChildNodes) {
+ DT.changeImmediateDominator(ChildNode, DT[preheader]);
}
ChildNodes.clear();