[ELF] - Simplify adjustSectionsBeforeSorting().
Does not seem we need to set SectionIndex here.
It is set in finalizeSections() later.
Differential revision: https://reviews.llvm.org/D37815
llvm-svn: 313522
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index ebbb8ef..a033cfc 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -668,8 +668,8 @@
// consequeces and gives us a section to put the symbol in.
uint64_t Flags = SHF_ALLOC;
- for (int I = 0, E = Opt.Commands.size(); I != E; ++I) {
- auto *Sec = dyn_cast<OutputSection>(Opt.Commands[I]);
+ for (BaseCommand * Cmd : Opt.Commands) {
+ auto *Sec = dyn_cast<OutputSection>(Cmd);
if (!Sec)
continue;
if (Sec->Live) {
@@ -681,7 +681,6 @@
continue;
Sec->Live = true;
- Sec->SectionIndex = I;
Sec->Flags = Flags;
}
}