diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-03-18 22:00:32 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-03-18 22:00:32 +0000 |
commit | 4c5001cc9c0dc346e2a7e4667b88304e7c1c2feb (patch) | |
tree | 6bbd67b92acd577d17c1f3bbba1426d592157a85 | |
parent | ae324439d03bb9b4dc5932fa37f3a7224309449d (diff) | |
download | bcm5719-llvm-4c5001cc9c0dc346e2a7e4667b88304e7c1c2feb.tar.gz bcm5719-llvm-4c5001cc9c0dc346e2a7e4667b88304e7c1c2feb.zip |
[LV] While I'm here, use range based for loops which are so much cleaner
for this kind of walk.
llvm-svn: 204188
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 1f02bf6cbe9..dc1ca5c291e 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -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; |