Use make_range(rbegin(), rend()) to allow foreach loops. NFC.
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfUnit.cpp
index 81dc2d1646ef3cd2372e280da7dc73cbd4007c79..2240868229be6e3b115ccd6dcd998e27bf298436 100644 (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)";