[llvm] e8991ca - Revert "[DebugInfo] Prevent non-determinism when updating DIArgList users of a value"

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 17 07:21:09 PDT 2021


Author: Stephen Tozer
Date: 2021-06-17T15:20:59+01:00
New Revision: e8991caea8690ec2d17b0b7e1c29bf0da6609076

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

LOG: 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.

Added: 
    

Modified: 
    llvm/lib/IR/Metadata.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index f039d91f82a4a..4d6ccfa43a640 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -196,21 +196,15 @@ bool MetadataTracking::isReplaceable(const Metadata &MD) {
 }
 
 SmallVector<Metadata *, 4> ReplaceableMetadataImpl::getAllArgListUsers() {
-  SmallVector<std::pair<OwnerTy, uint64_t> *> MDUsersWithID;
+  SmallVector<Metadata *, 4> MDUsers;
   for (auto Pair : UseMap) {
     OwnerTy Owner = Pair.second.first;
     if (!Owner.is<Metadata *>())
       continue;
     Metadata *OwnerMD = Owner.get<Metadata *>();
     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<Metadata *> MDUsers;
-  for (auto UserWithID : MDUsersWithID)
-    MDUsers.push_back(UserWithID->first.get<Metadata *>());
   return MDUsers;
 }
 


        


More information about the llvm-commits mailing list