[llvm] r236028 - Use range loops. NFC.

Rafael Espindola rafael.espindola at gmail.com
Tue Apr 28 13:23:35 PDT 2015


Author: rafael
Date: Tue Apr 28 15:23:35 2015
New Revision: 236028

URL: http://llvm.org/viewvc/llvm-project?rev=236028&view=rev
Log:
Use range loops. NFC.

Modified:
    llvm/trunk/lib/MC/ELFObjectWriter.cpp

Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=236028&r1=236027&r2=236028&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Apr 28 15:23:35 2015
@@ -939,20 +939,16 @@ bool ELFObjectWriter::isLocal(const MCSy
 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 ||





More information about the llvm-commits mailing list