From 032f234969e2bca5451ce966bef3f8e26a59a289 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236028 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/ELFObjectWriter.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 1b11451ac30..aaca625082d 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/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 ||