[PATCH] D22617: [ELF] - Linkerscript: add InputSectionDescription command to LS parser.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 21 05:37:10 PDT 2016
ruiu 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)
----------------
Again, InSec is a confusing name.
================
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;
+
----------------
Regular for-each loop is probably easier to read.
================
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;
----------------
Remove.
https://reviews.llvm.org/D22617
More information about the llvm-commits
mailing list