diff options
author | Pete Cooper <peter_cooper@apple.com> | 2015-07-24 21:13:43 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2015-07-24 21:13:43 +0000 |
commit | 7679afda82bb2401fe12f1a5d6c55876cfa8d04c (patch) | |
tree | 311a323dd1780c8e315e8da55eb90ff046efada2 /llvm/lib/IR | |
parent | 16bc6e172700bc61c979d37427f5f8a308ea6166 (diff) | |
download | bcm5719-llvm-7679afda82bb2401fe12f1a5d6c55876cfa8d04c.tar.gz bcm5719-llvm-7679afda82bb2401fe12f1a5d6c55876cfa8d04c.zip |
Use make_range(rbegin(), rend()) to allow foreach loops. NFC.
Instead of the pattern
for (auto I = x.rbegin(), E = x.end(); I != E; ++I)
we can use make_range to construct the reverse range and iterate using
that instead.
llvm-svn: 243163
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index d2d15b3a665..ec4370970ba 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -232,8 +232,7 @@ static UseListOrderStack predictUseListOrder(const Module *M) { // We want to visit the functions backward now so we can list function-local // constants in the last Function they're used in. Module-level constants // have already been visited above. - for (auto I = M->rbegin(), E = M->rend(); I != E; ++I) { - const Function &F = *I; + for (const Function &F : make_range(M->rbegin(), M->rend())) { if (F.isDeclaration()) continue; for (const BasicBlock &BB : F) |