[llvm] 527b9a9 - [DeadArgElim] Use structure bindings in foreach loops. NFC

Pavel Samolysov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 03:49:05 PDT 2022


Author: Pavel Samolysov
Date: 2022-09-01T13:48:46+03:00
New Revision: 527b9a9d908f10023290a5731b943ffe308d107c

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

LOG: [DeadArgElim] Use structure bindings in foreach loops. NFC

Differential Revision: https://reviews.llvm.org/D133026

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
index 99fa4baf355db..5cf6591a0c463 100644
--- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -238,8 +238,8 @@ bool DeadArgumentEliminationPass::deleteDeadVarargs(Function &F) {
   // Clone metadata from the old function, including debug info descriptor.
   SmallVector<std::pair<unsigned, MDNode *>, 1> MDs;
   F.getAllMetadata(MDs);
-  for (auto MD : MDs)
-    NF->addMetadata(MD.first, *MD.second);
+  for (auto [KindID, Node] : MDs)
+    NF->addMetadata(KindID, *Node);
 
   // Fix up any BlockAddresses that refer to the function.
   F.replaceAllUsesWith(ConstantExpr::getBitCast(NF, F.getType()));
@@ -1062,8 +1062,8 @@ bool DeadArgumentEliminationPass::removeDeadStuffFromFunction(Function *F) {
   // Clone metadata from the old function, including debug info descriptor.
   SmallVector<std::pair<unsigned, MDNode *>, 1> MDs;
   F->getAllMetadata(MDs);
-  for (auto MD : MDs)
-    NF->addMetadata(MD.first, *MD.second);
+  for (auto [KindID, Node] : MDs)
+    NF->addMetadata(KindID, *Node);
 
   // If either the return value(s) or argument(s) are removed, then probably the
   // function does not follow standard calling conventions anymore. Hence, add


        


More information about the llvm-commits mailing list