[PATCH] D14140: [ELF2] SECTIONS command basic support
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 28 02:12:16 PDT 2015
grimar added a subscriber: grimar.
================
Comment at: ELF/Writer.cpp:453
@@ +452,3 @@
+ return true;
+}
+
----------------
This could be in class declaration.
================
Comment at: ELF/Writer.cpp:495
@@ -450,4 +494,3 @@
else
- static_cast<MergeOutputSection<ELFT> *>(Sec)
- ->addSection(cast<MergeInputSection<ELFT>>(C));
+ llvm_unreachable("Wrong output section kind");
}
----------------
Does not seem that llvm_unreachable is really needed. Code just few lines above creates OutputSections or MergeOutputSections, no any other choices.
================
Comment at: ELF/Writer.cpp:885
@@ +884,3 @@
+ auto ItEnd = std::end(Config->OutputSections);
+ if (ItA == ItEnd || ItB == ItEnd)
+ return Writer<ELFT>::compareOutputSections(A, B);
----------------
This would work a bit faster in some cases:
if (Config->OutputSections.find(A->getName()) == ItEnd ||
Config->OutputSections.find(B->getName()) == ItEnd )
{...
http://reviews.llvm.org/D14140
More information about the llvm-commits
mailing list