[PATCH] D37815: [ELF] - Simplify adjustSectionsBeforeSorting().

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 01:45:13 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL313522: [ELF] - Simplify adjustSectionsBeforeSorting(). (authored by grimar).

Changed prior to commit:
  https://reviews.llvm.org/D37815?vs=115062&id=115609#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D37815

Files:
  lld/trunk/ELF/LinkerScript.cpp


Index: lld/trunk/ELF/LinkerScript.cpp
===================================================================
--- lld/trunk/ELF/LinkerScript.cpp
+++ lld/trunk/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;
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37815.115609.patch
Type: text/x-patch
Size: 678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170918/2aa35269/attachment.bin>


More information about the llvm-commits mailing list