[llvm] Use std::move to avoid copying (PR #116776)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 19 01:56:54 PST 2024
https://github.com/abhishek-kaushik22 created https://github.com/llvm/llvm-project/pull/116776
None
>From b7cd83fba132772673ce54505f10212eaacb34c0 Mon Sep 17 00:00:00 2001
From: abhishek-kaushik22 <abhishek.kaushik at intel.com>
Date: Tue, 19 Nov 2024 15:25:49 +0530
Subject: [PATCH] Use std::move to avoid copying
---
llvm/include/llvm/Transforms/Coroutines/ABI.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
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;
More information about the llvm-commits
mailing list