From 313ad85dfa40a18f2edefd7ce2edc0528d5a554a Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 3 Oct 2024 08:36:01 -0700 Subject: [PATCH] [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] --- llvm/include/llvm/Transforms/Coroutines/CoroSplit.h | 2 +- llvm/lib/Transforms/Coroutines/CoroSplit.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h b/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h index 74ee948a339e31..52b6c4918ada9b 100644 --- a/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h +++ b/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h @@ -23,7 +23,7 @@ namespace llvm { namespace coro { class BaseABI; -class Shape; +struct Shape; } // namespace coro struct CoroSplitPass : PassInfoMixin { diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp index 6fdead9a9c3501..4fbda077129fa5 100644 --- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp @@ -2222,7 +2222,7 @@ CoroSplitPass::CoroSplitPass(bool OptimizeFrame) std::unique_ptr ABI = CreateNewABI(F, S, coro::isTriviallyMaterializable); ABI->init(); - return std::move(ABI); + return ABI; }), OptimizeFrame(OptimizeFrame) {} @@ -2233,7 +2233,7 @@ CoroSplitPass::CoroSplitPass(std::function IsMatCallback, : CreateAndInitABI([=](Function &F, coro::Shape &S) { std::unique_ptr ABI = CreateNewABI(F, S, IsMatCallback); ABI->init(); - return std::move(ABI); + return ABI; }), OptimizeFrame(OptimizeFrame) {}