[PATCH] D23866: [ELF] - Linkerscript: do not use outputsections factory.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 30 02:32:22 PDT 2016
grimar added inline comments.
================
Comment at: ELF/LinkerScript.cpp:263
@@ +262,3 @@
+std::pair<OutputSectionBase<ELFT> *, bool>
+LinkerScript<ELFT>::createOutputSection(InputSectionBase<ELFT> *C,
+ StringRef Name) {
----------------
ruiu wrote:
> This can be a non-member function now, I guess?
Yep, done.
================
Comment at: ELF/LinkerScript.cpp:267
@@ +266,3 @@
+
+ OutputSectionBase<ELFT> *Sec = nullptr;
+ for (std::unique_ptr<OutputSectionBase<ELFT>> &S : OwningSections) {
----------------
ruiu wrote:
> Move the variable definition closer to the first use of the variable.
Done.
================
Comment at: ELF/LinkerScript.cpp:268
@@ +267,3 @@
+ OutputSectionBase<ELFT> *Sec = nullptr;
+ for (std::unique_ptr<OutputSectionBase<ELFT>> &S : OwningSections) {
+ if (S->getName() == Name)
----------------
ruiu wrote:
> Remove {}
I can't :( This is neccesary for VS2015, otherwise it shows:
error C2143: syntax error: missing ';' before '}'
================
Comment at: ELF/LinkerScript.h:180
@@ -176,1 +179,3 @@
+ std::vector<std::unique_ptr<OutputSectionBase<ELFT>>> OwningSections;
+
----------------
ruiu wrote:
> Use `Out<ELFT>::Pool` instead.
Done.
================
Comment at: ELF/OutputSections.cpp:1789
@@ +1788,3 @@
+ typename ELFT::uint Alignment, uint32_t Type) {
+ OutputSectionBase<ELFT> *Sec;
+ switch (Kind) {
----------------
ruiu wrote:
> Remove this variable and use early returns.
Done.
https://reviews.llvm.org/D23866
More information about the llvm-commits
mailing list