Use a range loop. NFC.

llvm-svn: 236047
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 90555ba..068c129 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1454,10 +1454,9 @@
   MCContext &Ctx = Asm.getContext();
 
   // Build the groups
-  for (MCAssembler::const_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.getFlags() & ELF::SHF_GROUP))
       continue;