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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243163 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Pete Cooper
2015-07-24 21:13:43 +00:00
parent d232d63fa2
commit 9f2f1650c4
10 changed files with 26 additions and 39 deletions

View File

@@ -804,8 +804,7 @@ std::string DwarfUnit::getParentContextString(const DIScope *Context) const {
// Reverse iterate over our list to go from the outermost construct to the
// innermost.
for (auto I = Parents.rbegin(), E = Parents.rend(); I != E; ++I) {
const DIScope *Ctx = *I;
for (const DIScope *Ctx : make_range(Parents.rbegin(), Parents.rend())) {
StringRef Name = Ctx->getName();
if (Name.empty() && isa<DINamespace>(Ctx))
Name = "(anonymous namespace)";