obj2yaml: Use the correct relocation type for different machine types
[oota-llvm.git] / lib / DebugInfo / DWARFDebugAbbrev.cpp
index a11ae3f2908e6ba493c2feb9509eebfaaaa69ae2..fd5f5e95fc14d03861d5c3d1d507f0cf2da60c87 100644 (file)
@@ -33,19 +33,17 @@ bool DWARFAbbreviationDeclarationSet::extract(DataExtractor data,
 }
 
 void DWARFAbbreviationDeclarationSet::dump(raw_ostream &OS) const {
-  for (unsigned i = 0, e = Decls.size(); i != e; ++i)
-    Decls[i].dump(OS);
+  for (const auto &Decl : Decls)
+    Decl.dump(OS);
 }
 
 const DWARFAbbreviationDeclaration*
 DWARFAbbreviationDeclarationSet::getAbbreviationDeclaration(uint32_t abbrCode)
   const {
   if (IdxOffset == UINT32_MAX) {
-    DWARFAbbreviationDeclarationCollConstIter pos;
-    DWARFAbbreviationDeclarationCollConstIter end = Decls.end();
-    for (pos = Decls.begin(); pos != end; ++pos) {
-      if (pos->getCode() == abbrCode)
-        return &(*pos);
+    for (const auto &Decl : Decls) {
+      if (Decl.getCode() == abbrCode)
+        return &Decl;
     }
   } else {
     uint32_t idx = abbrCode - IdxOffset;
@@ -81,10 +79,9 @@ void DWARFDebugAbbrev::dump(raw_ostream &OS) const {
     return;
   }
 
-  DWARFAbbreviationDeclarationCollMapConstIter pos;
-  for (pos = AbbrevCollMap.begin(); pos != AbbrevCollMap.end(); ++pos) {
-    OS << format("Abbrev table for offset: 0x%8.8x\n", pos->first);
-    pos->second.dump(OS);
+  for (const auto &I : AbbrevCollMap) {
+    OS << format("Abbrev table for offset: 0x%8.8" PRIx64 "\n", I.first);
+    I.second.dump(OS);
   }
 }