mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
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:
@@ -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)";
|
||||
|
Reference in New Issue
Block a user