[PATCH] D22749: [ELF] - Linkerscript: Implemented SORT command

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 15:50:29 PDT 2016


grimar added inline comments.

================
Comment at: ELF/LinkerScript.cpp:153
@@ +152,3 @@
+
+      std::vector<InputSectionBase<ELFT> *> Candidates;
+      for (InputSectionBase<ELFT> *S : getInputSections(InCmd)) {
----------------
ruiu wrote:
> Candidate for what? Maybe just `Sections` is better.
For adding :) Changed to Sections.

================
Comment at: ELF/LinkerScript.cpp:162
@@ -147,2 +161,3 @@
       }
-      Add(S, OutputName);
+      mayBeSort(Candidates, InCmd->Sort);
+      for (InputSectionBase<ELFT> *I : Candidates)
----------------
ruiu wrote:
> I don't think making this a separate function improves readability. This is probably better.
> 
>   if (InCmd->Sort)
>     std::stable_sort(Candidates.begin(), Candidates.end(), compareByName);
> 
> where compareByName is a separate file-scope function.
Done.


https://reviews.llvm.org/D22749





More information about the llvm-commits mailing list