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
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index d2d15b3..ec437097 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -232,8 +232,7 @@
// 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)