Skip to content

Commit c6bce68

Browse files
[NFC] [Coroutines] Use std::move to avoid copying (llvm#116776)
1 parent 2bf6751 commit c6bce68

File tree

1 file changed

+4
-4
lines changed
  • llvm/include/llvm/Transforms/Coroutines

1 file changed

+4
-4
lines changed

llvm/include/llvm/Transforms/Coroutines/ABI.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class BaseABI {
4141
public:
4242
BaseABI(Function &F, coro::Shape &S,
4343
std::function<bool(Instruction &)> IsMaterializable)
44-
: F(F), Shape(S), IsMaterializable(IsMaterializable) {}
44+
: F(F), Shape(S), IsMaterializable(std::move(IsMaterializable)) {}
4545
virtual ~BaseABI() = default;
4646

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

7272
void init() override;
7373

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

8585
void init() override;
8686

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

9898
void init() override;
9999

0 commit comments

Comments
 (0)