From ad3cfaaa20703dfed11945e26f7f9ca0afc06566 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 28 Apr 2015 20:23:35 +0000 Subject: [PATCH] Use range loops. NFC. llvm-svn: 236028 --- llvm/lib/MC/ELFObjectWriter.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index 1b11451..aaca625 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -939,20 +939,16 @@ bool ELFObjectWriter::isLocal(const MCSymbolData &Data, bool isUsedInReloc) { void ELFObjectWriter::computeIndexMap(MCAssembler &Asm, SectionIndexMapTy &SectionIndexMap) { unsigned Index = 1; - for (MCAssembler::iterator it = Asm.begin(), - ie = Asm.end(); it != ie; ++it) { + for (const MCSectionData &SD : Asm) { const MCSectionELF &Section = - static_cast(it->getSection()); + static_cast(SD.getSection()); if (Section.getType() != ELF::SHT_GROUP) continue; SectionIndexMap[&Section] = Index++; } std::vector RelSections; - - for (MCAssembler::iterator it = Asm.begin(), - ie = Asm.end(); it != ie; ++it) { - const MCSectionData &SD = *it; + for (const MCSectionData &SD : Asm) { const MCSectionELF &Section = static_cast(SD.getSection()); if (Section.getType() == ELF::SHT_GROUP || -- 2.7.4