[PATCH] D43468: [ELF] - Support "INSERT AFTER" statement.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 7 16:56:08 PST 2018
ruiu added inline comments.
================
Comment at: ELF/LinkerScript.cpp:206
+// This method used to handle INSERT AFTER statement. Here we rebuild
+// list of script commands to mix section inserted into.
----------------
used to -> is used to
================
Comment at: ELF/LinkerScript.cpp:213
+ if (auto *Cmd = dyn_cast<OutputSection>(Base)) {
+ std::vector<BaseCommand *> &InsertV = PendingInserts[Cmd->Name];
+ V.insert(V.end(), InsertV.begin(), InsertV.end());
----------------
InsertV is odd too -- maybe just W because it's next to V.
================
Comment at: ELF/LinkerScript.cpp:222
+
+ SectionCommands.swap(V);
+}
----------------
`SectionCommands = std::move(V)` is better I guess?
================
Comment at: ELF/LinkerScript.h:292
+
+ // Used to implement INSERT AFTER. Contains commands that needs
+ // to be inserted into SECTIONS commands list.
----------------
needs -> need
================
Comment at: ELF/LinkerScript.h:294
+ // to be inserted into SECTIONS commands list.
+ llvm::DenseMap<StringRef, std::vector<BaseCommand *>> PendingInserts;
};
----------------
`PendingInsert` sounds a bit odd. I'd name this `InsertAfterCommands`.
https://reviews.llvm.org/D43468
More information about the llvm-commits
mailing list