[llvm] [perf] Replace copy-assign by move-assign in llvm/lib/ExecutionEngine/* (PR #178173)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 27 03:54:42 PST 2026


https://github.com/serge-sans-paille created https://github.com/llvm/llvm-project/pull/178173

None

>From dd09048320a9982361b612871b36ee4a38e3f1e2 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton at mozilla.com>
Date: Tue, 27 Jan 2026 10:59:27 +0100
Subject: [PATCH] [perf] Replace copy-assign by move-assign in
 llvm/lib/ExecutionEngine/*

---
 llvm/lib/ExecutionEngine/ExecutionEngine.cpp          | 2 +-
 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp    | 2 +-
 llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index 01456d54465d2..38aed020bb119 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -486,7 +486,7 @@ EngineBuilder &EngineBuilder::setMCJITMemoryManager(
                                    std::unique_ptr<RTDyldMemoryManager> mcjmm) {
   auto SharedMM = std::shared_ptr<RTDyldMemoryManager>(std::move(mcjmm));
   MemMgr = SharedMM;
-  Resolver = SharedMM;
+  Resolver = std::move(SharedMM);
   return *this;
 }
 
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index 2d69edef878e6..9da7bce76dbf2 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -860,7 +860,7 @@ void Interpreter::popStackAndReturnValueToCaller(Type *RetTy,
 
   if (ECStack.empty()) {  // Finished main.  Put result into exit code...
     if (RetTy && !RetTy->isVoidTy()) {          // Nonvoid return type?
-      ExitValue = Result;   // Capture the exit value of the program
+      ExitValue = std::move(Result); // Capture the exit value of the program
     } else {
       memset(&ExitValue.Untyped, 0, sizeof(ExitValue.Untyped));
     }
diff --git a/llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp b/llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp
index cccb0b996aacb..b47f566b24eb7 100644
--- a/llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp
@@ -177,10 +177,10 @@ COFFVCRuntimeBootstrapper::getMSVCToolchainPath() {
   MSVCToolchainPath ToolchainPath;
   SmallString<256> VCToolchainLib(VCToolChainPath);
   sys::path::append(VCToolchainLib, "lib", "x64");
-  ToolchainPath.VCToolchainLib = VCToolchainLib;
+  ToolchainPath.VCToolchainLib = std::move(VCToolchainLib);
 
   SmallString<256> UCRTSdkLib(UniversalCRTSdkPath);
   sys::path::append(UCRTSdkLib, "Lib", UCRTVersion, "ucrt", "x64");
-  ToolchainPath.UCRTSdkLib = UCRTSdkLib;
+  ToolchainPath.UCRTSdkLib = std::move(UCRTSdkLib);
   return ToolchainPath;
 }



More information about the llvm-commits mailing list