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