MCDwarf: Simply MCDwarfFile since it really is just a StringRef and unsigned.
[oota-llvm.git] / lib / DebugInfo / DWARFDebugLoc.cpp
index 8fe7481bbfe45faa17ff446f85b1e7a785bbf770..5f0ff0240da61ab6be1339af972899f2c5aef748 100644 (file)
 using namespace llvm;
 
 void DWARFDebugLoc::dump(raw_ostream &OS) const {
-  for (LocationLists::const_iterator I = Locations.begin(), E = Locations.end(); I != E; ++I) {
-    OS << format("0x%8.8x: ", I->Offset);
+  for (const LocationList &L : Locations) {
+    OS << format("0x%8.8x: ", L.Offset);
     const unsigned Indent = 12;
-    for (SmallVectorImpl<Entry>::const_iterator I2 = I->Entries.begin(), E2 = I->Entries.end(); I2 != E2; ++I2) {
-      if (I2 != I->Entries.begin())
+    for (const Entry &E : L.Entries) {
+      if (&E != L.Entries.begin())
         OS.indent(Indent);
-      OS << "Beginning address offset: " << format("0x%016" PRIx64, I2->Begin)
+      OS << "Beginning address offset: " << format("0x%016" PRIx64, E.Begin)
          << '\n';
       OS.indent(Indent) << "   Ending address offset: "
-                        << format("0x%016" PRIx64, I2->End) << '\n';
+                        << format("0x%016" PRIx64, E.End) << '\n';
       OS.indent(Indent) << "    Location description: ";
-      for (SmallVectorImpl<unsigned char>::const_iterator I3 = I2->Loc.begin(), E3 = I2->Loc.end(); I3 != E3; ++I3) {
-        OS << format("%2.2x ", *I3);
+      for (unsigned char Loc : E.Loc) {
+        OS << format("%2.2x ", Loc);
       }
       OS << "\n\n";
     }