[lld] aad9076 - [ELF] RelocationSection<ELFT>::writeTo: use unstable partition

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 16 21:44:26 PST 2022


Author: Fangrui Song
Date: 2022-01-16T21:44:19-08:00
New Revision: aad90763d9046cb0bc6abc6214a496a4a5776250

URL: https://github.com/llvm/llvm-project/commit/aad90763d9046cb0bc6abc6214a496a4a5776250
DIFF: https://github.com/llvm/llvm-project/commit/aad90763d9046cb0bc6abc6214a496a4a5776250.diff

LOG: [ELF] RelocationSection<ELFT>::writeTo: use unstable partition

Added: 
    

Modified: 
    lld/ELF/SyntheticSections.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index 9944877acf6c..2bb94b54bc1e 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -1710,8 +1710,7 @@ template <class ELFT> void RelocationSection<ELFT>::writeTo(uint8_t *buf) {
   if (sort) {
     const RelType relativeRel = target->relativeRel;
     auto nonRelative =
-        std::stable_partition(relocs.begin(), relocs.end(),
-                              [=](auto &r) { return r.type == relativeRel; });
+        llvm::partition(relocs, [=](auto &r) { return r.type == relativeRel; });
     parallelSort(relocs.begin(), nonRelative,
                  [&](auto &a, auto &b) { return a.r_offset < b.r_offset; });
     // Non-relative relocations are few, so don't bother with parallelSort.


        


More information about the llvm-commits mailing list