Use a range loop. NFC.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 28 Apr 2015 19:07:16 +0000 (19:07 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 28 Apr 2015 19:07:16 +0000 (19:07 +0000)
llvm-svn: 236015

llvm/lib/MC/ELFObjectWriter.cpp

index 8a41654..ccf3a8e 100644 (file)
@@ -1611,9 +1611,8 @@ void ELFObjectWriter::WriteObject(MCAssembler &Asm,
   WriteHeader(Asm, NumSections + 1);
 
   // ... then the sections ...
-  for (unsigned i = 0; i < NumSections; ++i) {
-    const MCSectionELF &Section = *Sections[i];
-    const MCSectionData &SD = Asm.getOrCreateSectionData(Section);
+  for (const MCSectionELF *Section : Sections) {
+    const MCSectionData &SD = Asm.getOrCreateSectionData(*Section);
     uint64_t Padding = OffsetToAlignment(OS.tell(), SD.getAlignment());
     WriteZeros(Padding);