Skip to content

Commit

Permalink
[Coroutines] Fix warnings
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
kazutakahirata committed Oct 3, 2024
1 parent d412cea commit 313ad85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llvm/include/llvm/Transforms/Coroutines/CoroSplit.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace llvm {

namespace coro {
class BaseABI;
class Shape;
struct Shape;
} // namespace coro

struct CoroSplitPass : PassInfoMixin<CoroSplitPass> {
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Coroutines/CoroSplit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,7 @@ CoroSplitPass::CoroSplitPass(bool OptimizeFrame)
std::unique_ptr<coro::BaseABI> ABI =
CreateNewABI(F, S, coro::isTriviallyMaterializable);
ABI->init();
return std::move(ABI);
return ABI;
}),
OptimizeFrame(OptimizeFrame) {}

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

Expand Down

0 comments on commit 313ad85

Please sign in to comment.