Index: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h =================================================================== --- llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h +++ llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h @@ -84,7 +84,7 @@ template IncomingWFRHandler operator()(FnT &&Fn) { return IncomingWFRHandler( - [&D = this->D, Fn = std::move(Fn)] + [&D = this->D, Fn = std::forward(Fn)] (shared::WrapperFunctionResult WFR) mutable { D.dispatch( makeGenericNamedTask( @@ -323,10 +323,10 @@ void callSPSWrapperAsync(RunPolicyT &&Runner, ExecutorAddr WrapperFnAddr, SendResultT &&SendResult, const ArgTs &...Args) { shared::WrapperFunction::callAsync( - [this, WrapperFnAddr, Runner = std::move(Runner)] + [this, WrapperFnAddr, Runner = std::forward(Runner)] (auto &&SendResult, const char *ArgData, size_t ArgSize) mutable { this->callWrapperAsync(std::move(Runner), WrapperFnAddr, - std::move(SendResult), + std::forward(SendResult), ArrayRef(ArgData, ArgSize)); }, std::forward(SendResult), Args...); Index: llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h =================================================================== --- llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h +++ llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h @@ -288,7 +288,7 @@ } auto SendResult = - [SendWFR = std::move(SendWrapperFunctionResult)](auto Result) mutable { + [SendWFR = std::forward(SendWrapperFunctionResult)](auto Result) mutable { using ResultT = decltype(Result); SendWFR(ResultSerializer::serialize(std::move(Result))); }; @@ -311,7 +311,7 @@ SerializeAndSendResultT &&SerializeAndSendResult, ArgTupleT Args, std::index_sequence) { (void)Args; // Silence a buggy GCC warning. - return std::forward(H)(std::move(SerializeAndSendResult), + return std::forward(H)(std::forward(SerializeAndSendResult), std::move(std::get(Args))...); } }; @@ -490,7 +490,7 @@ return; } - auto SendSerializedResult = [SDR = std::move(SendDeserializedResult)]( + auto SendSerializedResult = [SDR = std::forward(SendDeserializedResult)]( WrapperFunctionResult R) mutable { RetT RetVal = detail::ResultDeserializer::makeValue(); detail::ResultDeserializer::makeSafe(RetVal); @@ -565,7 +565,7 @@ const ArgTs &...Args) { WrapperFunction::callAsync( std::forward(Caller), - [SDR = std::move(SendDeserializedResult)](Error SerializeErr, + [SDR = std::forward(SendDeserializedResult)](Error SerializeErr, SPSEmpty E) mutable { SDR(std::move(SerializeErr)); }, Index: llvm/include/llvm/Support/MSVCErrorWorkarounds.h =================================================================== --- llvm/include/llvm/Support/MSVCErrorWorkarounds.h +++ llvm/include/llvm/Support/MSVCErrorWorkarounds.h @@ -60,7 +60,7 @@ MSVCPExpected( OtherT &&Val, std::enable_if_t::value> * = nullptr) - : Expected(std::move(Val)) {} + : Expected(std::forward(Val)) {} template MSVCPExpected( Index: llvm/include/llvm/Support/TaskQueue.h =================================================================== --- llvm/include/llvm/Support/TaskQueue.h +++ llvm/include/llvm/Support/TaskQueue.h @@ -83,7 +83,7 @@ static_assert(false, "TaskQueue requires building with LLVM_ENABLE_THREADS!"); #endif - Task T{std::move(C), *this}; + Task T{std::forward(C), *this}; using ResultTy = std::invoke_result_t; std::future F = T.P->get_future(); { Index: llvm/include/llvm/Support/raw_ostream.h =================================================================== --- llvm/include/llvm/Support/raw_ostream.h +++ llvm/include/llvm/Support/raw_ostream.h @@ -406,7 +406,7 @@ OStream &&> operator<<(OStream &&OS, const T &Value) { OS << Value; - return std::move(OS); + return std::forward(OS); } /// An abstract base class for streams implementations that also support a