[llvm] Remove redundant move in return statement (PR #90546)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 3 19:14:19 PDT 2024
https://github.com/xiaoleis-nv updated https://github.com/llvm/llvm-project/pull/90546
>From 3d506b30122bc3876795049aa10f4a308546e362 Mon Sep 17 00:00:00 2001
From: Xiaolei Shi <xiaoleis at nvidia.com>
Date: Tue, 30 Apr 2024 10:35:15 +0800
Subject: [PATCH] remove redundant move in return statement
---
llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h | 2 +-
llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
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