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

Xuanda Yang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 23:30:32 PDT 2021


TH3CHARLie updated this revision to Diff 352349.
TH3CHARLie added a comment.

Use `llvm::parallelSort`


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();
-    });
+    llvm::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.352349.patch
Type: text/x-patch
Size: 672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210616/718e8430/attachment.bin>


More information about the llvm-commits mailing list