[PATCH] D102972: [lld-macho][nfc] Sort OutputSections based on explicit order of command-line inputs

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 22 20:09:52 PDT 2021


int3 marked an inline comment as done.
int3 added inline comments.


================
Comment at: lld/MachO/OutputSegment.h:47
       llvm::function_ref<bool(OutputSection *, OutputSection *)> comparator) {
-    llvm::stable_sort(sections, comparator);
+    llvm::sort(sections, comparator);
   }
----------------
int3 wrote:
> alexshap wrote:
> > the presence of `comparator` and `inputOrder`, perhaps, deserves some comments
> > (e.g. are there any places where sections are sorted using different comparators ?)
> > otherwise this probably can be simplified a bit.
> There's only one comparator... I think this only exists so that all the segment+section sorting code could live together in Writer.cpp. But yeah we can simplify it by moving all the sorting code into OutputSegment.cpp instead. Out of scope for this diff though
{D102974}


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102972/new/

https://reviews.llvm.org/D102972



More information about the llvm-commits mailing list