[llvm] 32ab097 - Partially revert "Use llvm::less_second (NFC)"
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue May 16 14:49:43 PDT 2023
Author: Kazu Hirata
Date: 2023-05-16T14:49:32-07:00
New Revision: 32ab0978dc3f7f7036df2038ee96a4ab89196255
URL: https://github.com/llvm/llvm-project/commit/32ab0978dc3f7f7036df2038ee96a4ab89196255
DIFF: https://github.com/llvm/llvm-project/commit/32ab0978dc3f7f7036df2038ee96a4ab89196255.diff
LOG: Partially revert "Use llvm::less_second (NFC)"
This reverts part of commit e0039b8d6a5bd05e70203962f448569f2d2ef1c2.
This should fix the issue reported in:
https://github.com/llvm/llvm-project/issues/62546
Added:
Modified:
llvm/lib/IR/Metadata.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 13fb2b650f89e..face1ba58cfbb 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -282,7 +282,9 @@ void ReplaceableMetadataImpl::replaceAllUsesWith(Metadata *MD) {
// Copy out uses since UseMap will get touched below.
using UseTy = std::pair<void *, std::pair<OwnerTy, uint64_t>>;
SmallVector<UseTy, 8> Uses(UseMap.begin(), UseMap.end());
- llvm::sort(Uses, llvm::less_second());
+ llvm::sort(Uses, [](const UseTy &L, const UseTy &R) {
+ return L.second.second < R.second.second;
+ });
for (const auto &Pair : Uses) {
// Check that this Ref hasn't disappeared after RAUW (when updating a
// previous Ref).
More information about the llvm-commits
mailing list