diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-07-19 17:50:24 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-07-19 17:50:24 +0000 |
commit | 1a4576e79da54a172b840c3ff269fd2f8bcdef19 (patch) | |
tree | d68fee8022f104f440b6036563d00199d692ef7f /llvm/lib/Analysis/LoopPass.cpp | |
parent | 887ad0e9db84b7b08daa8606705e5cf83edea81b (diff) | |
download | bcm5719-llvm-1a4576e79da54a172b840c3ff269fd2f8bcdef19.tar.gz bcm5719-llvm-1a4576e79da54a172b840c3ff269fd2f8bcdef19.zip |
[LoopPass] Some minor cleanups
No functional change is intended.
llvm-svn: 275999
Diffstat (limited to 'llvm/lib/Analysis/LoopPass.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopPass.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp index 222345c9a98..98103c12320 100644 --- a/llvm/lib/Analysis/LoopPass.cpp +++ b/llvm/lib/Analysis/LoopPass.cpp @@ -131,8 +131,8 @@ void LPPassManager::deleteSimpleAnalysisLoop(Loop *L) { // Recurse through all subloops and all loops into LQ. static void addLoopIntoQueue(Loop *L, std::deque<Loop *> &LQ) { LQ.push_back(L); - for (Loop::reverse_iterator I = L->rbegin(), E = L->rend(); I != E; ++I) - addLoopIntoQueue(*I, LQ); + for (Loop *I : reverse(*L)) + addLoopIntoQueue(I, LQ); } /// Pass Manager itself does not invalidate any analysis info. @@ -162,16 +162,14 @@ bool LPPassManager::runOnFunction(Function &F) { // Note that LoopInfo::iterator visits loops in reverse program // order. Here, reverse_iterator gives us a forward order, and the LoopQueue // reverses the order a third time by popping from the back. - for (LoopInfo::reverse_iterator I = LI->rbegin(), E = LI->rend(); I != E; ++I) - addLoopIntoQueue(*I, LQ); + for (Loop *L : reverse(*LI)) + addLoopIntoQueue(L, LQ); if (LQ.empty()) // No loops, skip calling finalizers return false; // Initialization - for (std::deque<Loop *>::const_iterator I = LQ.begin(), E = LQ.end(); - I != E; ++I) { - Loop *L = *I; + for (Loop *L : LQ) { for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { LoopPass *P = getContainedPass(Index); Changed |= P->doInitialization(L, *this); |