Skip to content

[NFC] [Coroutines] Use std::move to avoid copying #116776

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 1 commit into from
Nov 20, 2024
Merged
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
8 changes: 4 additions & 4 deletions llvm/include/llvm/Transforms/Coroutines/ABI.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class BaseABI {
public:
BaseABI(Function &F, coro::Shape &S,
std::function<bool(Instruction &)> IsMaterializable)
: F(F), Shape(S), IsMaterializable(IsMaterializable) {}
: F(F), Shape(S), IsMaterializable(std::move(IsMaterializable)) {}
virtual ~BaseABI() = default;

// Initialize the coroutine ABI
Expand All @@ -67,7 +67,7 @@ class SwitchABI : public BaseABI {
public:
SwitchABI(Function &F, coro::Shape &S,
std::function<bool(Instruction &)> IsMaterializable)
: BaseABI(F, S, IsMaterializable) {}
: BaseABI(F, S, std::move(IsMaterializable)) {}

void init() override;

Expand All @@ -80,7 +80,7 @@ class AsyncABI : public BaseABI {
public:
AsyncABI(Function &F, coro::Shape &S,
std::function<bool(Instruction &)> IsMaterializable)
: BaseABI(F, S, IsMaterializable) {}
: BaseABI(F, S, std::move(IsMaterializable)) {}

void init() override;

Expand All @@ -93,7 +93,7 @@ class AnyRetconABI : public BaseABI {
public:
AnyRetconABI(Function &F, coro::Shape &S,
std::function<bool(Instruction &)> IsMaterializable)
: BaseABI(F, S, IsMaterializable) {}
: BaseABI(F, S, std::move(IsMaterializable)) {}

void init() override;

Expand Down
Loading