[llvm-branch-commits] [llvm] 0377438 - Revert "Remove redundant move in return statement (#90546)"

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 6 00:47:29 PDT 2024


Author: Mehdi Amini
Date: 2024-05-06T15:47:26+08:00
New Revision: 037743895cde439e45ceba5ab171db252d3c8e62

URL: https://github.com/llvm/llvm-project/commit/037743895cde439e45ceba5ab171db252d3c8e62
DIFF: https://github.com/llvm/llvm-project/commit/037743895cde439e45ceba5ab171db252d3c8e62.diff

LOG: Revert "Remove redundant move in return statement (#90546)"

This reverts commit db532ff9584a2fe4b375188400986e0dd17ad92b.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
    llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
index 6dd99a76cf2afb..f0263e0d78e75e 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
@@ -77,7 +77,7 @@ class TrampolinePool {
     std::lock_guard<std::mutex> Lock(TPMutex);
     if (AvailableTrampolines.empty()) {
       if (auto Err = grow())
-        return Err;
+        return std::move(Err);
     }
     assert(!AvailableTrampolines.empty() && "Failed to grow trampoline pool");
     auto TrampolineAddr = AvailableTrampolines.back();

diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
index 2608a95e40a36b..3a71ddc88ce956 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
@@ -488,18 +488,18 @@ class LLJITBuilderSetters {
   /// Create an instance of the JIT.
   Expected<std::unique_ptr<JITType>> create() {
     if (auto Err = impl().prepareForConstruction())
-      return Err;
+      return std::move(Err);
 
     Error Err = Error::success();
     std::unique_ptr<JITType> J(new JITType(impl(), Err));
     if (Err)
-      return Err;
+      return std::move(Err);
 
     if (impl().NotifyCreated)
       if (Error Err = impl().NotifyCreated(*J))
-        return Err;
+        return std::move(Err);
 
-    return J;
+    return std::move(J);
   }
 
 protected:


        


More information about the llvm-branch-commits mailing list