From 32ab0978dc3f7f7036df2038ee96a4ab89196255 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 16 May 2023 14:49:32 -0700 Subject: [PATCH] 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 --- llvm/lib/IR/Metadata.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index 13fb2b6..face1ba 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>; SmallVector 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). -- 2.7.4