Skip to content

Commit 313ad85

Browse files
[Coroutines] Fix warnings
This patch fixes: llvm/include/llvm/Transforms/Coroutines/CoroSplit.h:26:1: note: did you mean struct here? llvm/lib/Transforms/Coroutines/CoroSplit.cpp:2225:16: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move] llvm/lib/Transforms/Coroutines/CoroSplit.cpp:2236:16: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
1 parent d412cea commit 313ad85

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/include/llvm/Transforms/Coroutines/CoroSplit.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace llvm {
2323

2424
namespace coro {
2525
class BaseABI;
26-
class Shape;
26+
struct Shape;
2727
} // namespace coro
2828

2929
struct CoroSplitPass : PassInfoMixin<CoroSplitPass> {

llvm/lib/Transforms/Coroutines/CoroSplit.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,7 @@ CoroSplitPass::CoroSplitPass(bool OptimizeFrame)
22222222
std::unique_ptr<coro::BaseABI> ABI =
22232223
CreateNewABI(F, S, coro::isTriviallyMaterializable);
22242224
ABI->init();
2225-
return std::move(ABI);
2225+
return ABI;
22262226
}),
22272227
OptimizeFrame(OptimizeFrame) {}
22282228

@@ -2233,7 +2233,7 @@ CoroSplitPass::CoroSplitPass(std::function<bool(Instruction &)> IsMatCallback,
22332233
: CreateAndInitABI([=](Function &F, coro::Shape &S) {
22342234
std::unique_ptr<coro::BaseABI> ABI = CreateNewABI(F, S, IsMatCallback);
22352235
ABI->init();
2236-
return std::move(ABI);
2236+
return ABI;
22372237
}),
22382238
OptimizeFrame(OptimizeFrame) {}
22392239

0 commit comments

Comments
 (0)