[lld] 04f5eb4 - [lld/mac] Fix start-stop.s test with expensive checks enabled

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 23 14:01:23 PDT 2021


Author: Nico Weber
Date: 2021-07-23T17:01:16-04:00
New Revision: 04f5eb407c74d433589739a719c3fc75a08859b3

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

LOG: [lld/mac] Fix start-stop.s test with expensive checks enabled

See e.g. https://lab.llvm.org/buildbot/#/builders/16/builds/14317
Not 100% sure why this fails yet, but this fixes it. Let's get
the bots green again first :)

Differential Revision: https://reviews.llvm.org/D106711

Added: 
    

Modified: 
    lld/MachO/OutputSegment.cpp

Removed: 
    


################################################################################
diff  --git a/lld/MachO/OutputSegment.cpp b/lld/MachO/OutputSegment.cpp
index 8a050c4a7627b..7345bf074b2ec 100644
--- a/lld/MachO/OutputSegment.cpp
+++ b/lld/MachO/OutputSegment.cpp
@@ -146,10 +146,8 @@ void OutputSegment::sortOutputSections() {
 }
 
 void macho::sortOutputSegments() {
-  // sort() instead of stable_sort() is fine because segmentOrder() is
-  // name-based and getOrCreateOutputSegment() makes there's only a single
-  // segment for every name.
-  llvm::sort(outputSegments, compareByOrder<OutputSegment *>(segmentOrder));
+  llvm::stable_sort(outputSegments,
+                    compareByOrder<OutputSegment *>(segmentOrder));
 }
 
 static DenseMap<StringRef, OutputSegment *> nameToOutputSegment;


        


More information about the llvm-commits mailing list