-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[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
Conversation
@llvm/pr-subscribers-coroutines @llvm/pr-subscribers-llvm-transforms Author: None (abhishek-kaushik22) ChangesFull diff: https://github.com/llvm/llvm-project/pull/116776.diff 1 Files Affected:
diff --git a/llvm/include/llvm/Transforms/Coroutines/ABI.h b/llvm/include/llvm/Transforms/Coroutines/ABI.h
index 8b83c5308056eb..0b2d405f3caec4 100644
--- a/llvm/include/llvm/Transforms/Coroutines/ABI.h
+++ b/llvm/include/llvm/Transforms/Coroutines/ABI.h
@@ -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
@@ -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;
@@ -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;
@@ -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;
|
@ChuanqiXu9 @TylerNowicki can you please review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive by: Make sure to update the commit message before you merge such that it follows the guidelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add NFC to the title.
@Flakebi @ChuanqiXu9 can you please merge? |
Done |
No description provided.