From 9e62b779cc9114fcb4e8bc48c6090c6e90eeb2e3 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Tue, 27 Jan 2026 20:46:47 +0000 Subject: [PATCH] [perf] Replace copy-assign by move-assign in llvm/lib/IR/* (#178175) --- llvm/lib/IR/AsmWriter.cpp | 8 ++++---- llvm/lib/IR/ConstantRangeList.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 82e4de6d0744..b3e0323fd863 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -1010,13 +1010,13 @@ int ModuleSlotTracker::getLocalSlot(const Value *V) { void ModuleSlotTracker::setProcessHook( std::function Fn) { - ProcessModuleHookFn = Fn; + ProcessModuleHookFn = std::move(Fn); } void ModuleSlotTracker::setProcessHook( std::function Fn) { - ProcessFunctionHookFn = Fn; + ProcessFunctionHookFn = std::move(Fn); } static SlotTracker *createSlotTracker(const Value *V) { @@ -1304,13 +1304,13 @@ int SlotTracker::getGlobalSlot(const GlobalValue *V) { void SlotTracker::setProcessHook( std::function Fn) { - ProcessModuleHookFn = Fn; + ProcessModuleHookFn = std::move(Fn); } void SlotTracker::setProcessHook( std::function Fn) { - ProcessFunctionHookFn = Fn; + ProcessFunctionHookFn = std::move(Fn); } /// getMetadataSlot - Get the slot number of a MDNode. diff --git a/llvm/lib/IR/ConstantRangeList.cpp b/llvm/lib/IR/ConstantRangeList.cpp index 3ee8d6f22b74..d41efe9dbae2 100644 --- a/llvm/lib/IR/ConstantRangeList.cpp +++ b/llvm/lib/IR/ConstantRangeList.cpp @@ -139,7 +139,7 @@ void ConstantRangeList::subtract(const ConstantRange &SubRange) { } } - Ranges = Result; + Ranges = std::move(Result); } ConstantRangeList