[llvm] 14c5098 - llvm-reduce: Use takeName when moving arguments in operands-to-args (#133851)

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 1 00:48:19 PDT 2025


Author: Matt Arsenault
Date: 2025-04-01T14:48:14+07:00
New Revision: 14c50986405731030b001d85cc8cd4a2c9f86388

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

LOG: llvm-reduce: Use takeName when moving arguments in operands-to-args (#133851)

Added: 
    

Modified: 
    llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp b/llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp
index 3548130d3276a..4bae588d60c14 100644
--- a/llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp
+++ b/llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp
@@ -155,8 +155,8 @@ static void substituteOperandWithArgument(Function *OldF,
     Argument &OldArg = std::get<0>(Z);
     Argument &NewArg = std::get<1>(Z);
 
-    NewArg.setName(OldArg.getName()); // Copy the name over...
-    VMap[&OldArg] = &NewArg;          // Add mapping to VMap
+    NewArg.takeName(&OldArg); // Copy the name over...
+    VMap[&OldArg] = &NewArg;  // Add mapping to VMap
   }
 
   LLVMContext &Ctx = OldF->getContext();


        


More information about the llvm-commits mailing list