Use range loops. NFC.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 28 Apr 2015 20:23:35 +0000 (20:23 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 28 Apr 2015 20:23:35 +0000 (20:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236028 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/ELFObjectWriter.cpp

index 1b11451ac3098076a91d2647de0e86942dbd19aa..aaca625082df1f04a5fe4b6d2b73be36a2528645 100644 (file)
@@ -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<const MCSectionELF &>(it->getSection());
+        static_cast<const MCSectionELF &>(SD.getSection());
     if (Section.getType() != ELF::SHT_GROUP)
       continue;
     SectionIndexMap[&Section] = Index++;
   }
 
   std::vector<const MCSectionELF *> 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<const MCSectionELF &>(SD.getSection());
     if (Section.getType() == ELF::SHT_GROUP ||