Skip to content

Revert "Remove redundant move in return statement" #91169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down