Skip to content

[lld] Use llvm::less_second (NFC) #141349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented May 24, 2025

@llvm/pr-subscribers-lld-macho

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/141349.diff

1 Files Affected:

  • (modified) lld/MachO/SyntheticSections.cpp (+1-4)
diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp
index dfacaf2ef4e0d..c98264871495b 100644
--- a/lld/MachO/SyntheticSections.cpp
+++ b/lld/MachO/SyntheticSections.cpp
@@ -1248,10 +1248,7 @@ void SymtabSection::emitStabs() {
     }
   }
 
-  llvm::stable_sort(symbolsNeedingStabs,
-                    [&](const SortingPair &a, const SortingPair &b) {
-                      return a.second < b.second;
-                    });
+  llvm::stable_sort(symbolsNeedingStabs, llvm::less_second());
 
   // Emit STABS symbols so that dsymutil and/or the debugger can map address
   // regions in the final binary to the source and object files from which they

@llvmbot
Copy link
Member

llvmbot commented May 24, 2025

@llvm/pr-subscribers-lld

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/141349.diff

1 Files Affected:

  • (modified) lld/MachO/SyntheticSections.cpp (+1-4)
diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp
index dfacaf2ef4e0d..c98264871495b 100644
--- a/lld/MachO/SyntheticSections.cpp
+++ b/lld/MachO/SyntheticSections.cpp
@@ -1248,10 +1248,7 @@ void SymtabSection::emitStabs() {
     }
   }
 
-  llvm::stable_sort(symbolsNeedingStabs,
-                    [&](const SortingPair &a, const SortingPair &b) {
-                      return a.second < b.second;
-                    });
+  llvm::stable_sort(symbolsNeedingStabs, llvm::less_second());
 
   // Emit STABS symbols so that dsymutil and/or the debugger can map address
   // regions in the final binary to the source and object files from which they

@kazutakahirata kazutakahirata merged commit 1f3b6d8 into llvm:main May 24, 2025
14 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250524_llvm_less_second_macho branch May 24, 2025 16:37
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants