[PATCH] D104346: [lld][MachO] Sort symbols in parallel in -map

Xuanda Yang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 16 19:20:34 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG01cb9c5fc52b: [lld][MachO] Sort symbols in parallel in -map (authored by TH3CHARLie).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104346

Files:
  lld/MachO/MapFile.cpp


Index: lld/MachO/MapFile.cpp
===================================================================
--- lld/MachO/MapFile.cpp
+++ lld/MachO/MapFile.cpp
@@ -52,9 +52,11 @@
   // appear in the output file rather than the order they appeared in the input
   // files.
   for (auto &it : ret)
-    llvm::stable_sort(it.second, [](Defined *a, Defined *b) {
-      return a->getVA() < b->getVA();
-    });
+    parallelSort(
+        it.second.begin(), it.second.end(), [](Defined *a, Defined *b) {
+          return a->getVA() != b->getVA() ? a->getVA() < b->getVA()
+                                          : a->getName() < b->getName();
+        });
   return ret;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104346.352604.patch
Type: text/x-patch
Size: 666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210617/7c5a6390/attachment.bin>


More information about the llvm-commits mailing list