From e8991caea8690ec2d17b0b7e1c29bf0da6609076 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Thu, 17 Jun 2021 15:20:06 +0100 Subject: [PATCH] Revert "[DebugInfo] Prevent non-determinism when updating DIArgList users of a value" Commit caused build errors on buildbots with [-Werror,-Wreturn-std-move] enabled. This reverts commit fa1de88f81e9c6db5255ca7c4d0fd25606c5a054. --- llvm/lib/IR/Metadata.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index f039d91f..4d6ccfa 100644 --- a/llvm/lib/IR/Metadata.cpp +++ b/llvm/lib/IR/Metadata.cpp @@ -196,21 +196,15 @@ bool MetadataTracking::isReplaceable(const Metadata &MD) { } SmallVector ReplaceableMetadataImpl::getAllArgListUsers() { - SmallVector *> MDUsersWithID; + SmallVector MDUsers; for (auto Pair : UseMap) { OwnerTy Owner = Pair.second.first; if (!Owner.is()) continue; Metadata *OwnerMD = Owner.get(); if (OwnerMD->getMetadataID() == Metadata::DIArgListKind) - MDUsersWithID.push_back(&UseMap[Pair.first]); + MDUsers.push_back(OwnerMD); } - llvm::sort(MDUsersWithID, [](auto UserA, auto UserB) { - return UserA->second < UserB->second; - }); - SmallVector MDUsers; - for (auto UserWithID : MDUsersWithID) - MDUsers.push_back(UserWithID->first.get()); return MDUsers; } -- 2.7.4