[PATCH] D22617: [ELF] - Linkerscript: add InputSectionDescription command to LS parser.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 05:53:56 PDT 2016


grimar added inline comments.

================
Comment at: ELF/LinkerScript.cpp:240
@@ +239,3 @@
+    for (const std::unique_ptr<BaseCommand> &Cmd : OutCmd->Commands) {
+      auto *InSec = dyn_cast<InputSectionDescription>(Cmd.get());
+      if (!InSec)
----------------
ruiu wrote:
> Again, InSec is a confusing name.
Fixed.

================
Comment at: ELF/LinkerScript.cpp:249-253
@@ +248,7 @@
+
+          auto I = llvm::find_if(InSec->Patterns, [S](StringRef &P) {
+            return globMatch(P, S->getSectionName());
+          });
+          if (I == InSec->Patterns.end())
+            continue;
+
----------------
ruiu wrote:
> Regular for-each loop is probably easier to read.
Changed.

================
Comment at: ELF/LinkerScript.h:93-94
@@ -100,2 +92,4 @@
   // be kept even if they are unused and --gc-sections is specified.
+  // It is the same information that can be found in Commands,
+  // but extracted for simplicity and possible speedup.
   std::vector<StringRef> KeptSections;
----------------
ruiu wrote:
> Remove.
Done.


https://reviews.llvm.org/D22617





More information about the llvm-commits mailing list