Make a local variable scope narrower. NFC.
authorRui Ueyama <ruiu@google.com>
Wed, 24 Oct 2018 13:42:33 +0000 (13:42 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 24 Oct 2018 13:42:33 +0000 (13:42 +0000)
llvm-svn: 345138

lld/ELF/Writer.cpp

index 60f5ff9..77ef252 100644 (file)
@@ -1675,9 +1675,9 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
   // particularly relevant.
   Out::ElfHeader->SectionIndex = 1;
 
-  unsigned I = 1;
-  for (OutputSection *Sec : OutputSections) {
-    Sec->SectionIndex = I++;
+  for (size_t I = 0, E = OutputSections.size(); I != E; ++I) {
+    OutputSection *Sec = OutputSections[I];
+    Sec->SectionIndex = I + 1;
     Sec->ShName = In.ShStrTab->addString(Sec->Name);
   }