[llvm] db532ff - Remove redundant move in return statement (#90546)

via llvm-commits llvm-commits at lists.llvm.org
Sun May 5 23:30:08 PDT 2024


Author: xiaoleis-nv
Date: 2024-05-06T14:30:04+08:00
New Revision: db532ff9584a2fe4b375188400986e0dd17ad92b

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

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

This pull request removes unnecessary move in the return statement to
suppress compilation warnings.

Co-authored-by: Xiaolei Shi <xiaoleis at nvidia.com>

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 f0263e0d78e75e..6dd99a76cf2afb 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 std::move(Err);
+        return 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 3a71ddc88ce956..2608a95e40a36b 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 std::move(Err);
+      return Err;
 
     Error Err = Error::success();
     std::unique_ptr<JITType> J(new JITType(impl(), Err));
     if (Err)
-      return std::move(Err);
+      return Err;
 
     if (impl().NotifyCreated)
       if (Error Err = impl().NotifyCreated(*J))
-        return std::move(Err);
+        return Err;
 
-    return std::move(J);
+    return J;
   }
 
 protected:


        


More information about the llvm-commits mailing list