[LV] While I'm here, use range based for loops which are so much cleaner

for this kind of walk.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204188 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth 2014-03-18 22:00:32 +00:00
parent 633eb08d31
commit 3c1eb9903b

View File

@ -989,12 +989,12 @@ private:
}
};
static void addInnerLoop(Loop *L, SmallVectorImpl<Loop *> &V) {
if (L->empty())
return V.push_back(L);
static void addInnerLoop(Loop &L, SmallVectorImpl<Loop *> &V) {
if (L.empty())
return V.push_back(&L);
for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
addInnerLoop(*I, V);
for (Loop *InnerL : L)
addInnerLoop(*InnerL, V);
}
/// The LoopVectorize Pass.
@ -1051,8 +1051,8 @@ struct LoopVectorize : public FunctionPass {
// and can invalidate iterators across the loops.
SmallVector<Loop *, 8> Worklist;
for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I)
addInnerLoop(*I, Worklist);
for (Loop *L : *LI)
addInnerLoop(*L, Worklist);
// Now walk the identified inner loops.
bool Changed = false;