Use range loop. NFC.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 21 Jul 2015 16:40:14 +0000 (16:40 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 21 Jul 2015 16:40:14 +0000 (16:40 +0000)
llvm-svn: 242801

llvm/tools/obj2yaml/elf2yaml.cpp

index f117a10..5e70448 100644 (file)
@@ -123,17 +123,17 @@ ErrorOr<ELFYAML::Object *> ELFDumper<ELFT>::dump() {
 
   // Dump symbols
   bool IsFirstSym = true;
-  for (auto SI = Obj.symbol_begin(), SE = Obj.symbol_end(); SI != SE; ++SI) {
+  for (const Elf_Sym &Sym : Obj.symbols()) {
     if (IsFirstSym) {
       IsFirstSym = false;
       continue;
     }
 
     ELFYAML::Symbol S;
-    if (std::error_code EC = ELFDumper<ELFT>::dumpSymbol(SI, false, S))
+    if (std::error_code EC = ELFDumper<ELFT>::dumpSymbol(&Sym, false, S))
       return EC;
 
-    switch (SI->getBinding())
+    switch (Sym.getBinding())
     {
     case ELF::STB_LOCAL:
       Y->Symbols.Local.push_back(S);