diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp index 88ce331c8cfb6..0395ee62ae988 100644 --- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp @@ -2211,17 +2211,13 @@ CreateNewABI(Function &F, coro::Shape &S, switch (S.ABI) { case coro::ABI::Switch: - return std::unique_ptr( - new coro::SwitchABI(F, S, IsMatCallback)); + return std::make_unique(F, S, IsMatCallback); case coro::ABI::Async: - return std::unique_ptr( - new coro::AsyncABI(F, S, IsMatCallback)); + return std::make_unique(F, S, IsMatCallback); case coro::ABI::Retcon: - return std::unique_ptr( - new coro::AnyRetconABI(F, S, IsMatCallback)); + return std::make_unique(F, S, IsMatCallback); case coro::ABI::RetconOnce: - return std::unique_ptr( - new coro::AnyRetconABI(F, S, IsMatCallback)); + return std::make_unique(F, S, IsMatCallback); } llvm_unreachable("Unknown ABI"); } diff --git a/llvm/unittests/Transforms/Coroutines/ExtraRematTest.cpp b/llvm/unittests/Transforms/Coroutines/ExtraRematTest.cpp index c3394fdaa940b..68bf640334b5f 100644 --- a/llvm/unittests/Transforms/Coroutines/ExtraRematTest.cpp +++ b/llvm/unittests/Transforms/Coroutines/ExtraRematTest.cpp @@ -247,7 +247,7 @@ TEST_F(ExtraRematTest, TestCoroRematWithCustomABI) { ASSERT_TRUE(M); CoroSplitPass::BaseABITy GenCustomABI = [](Function &F, coro::Shape &S) { - return std::unique_ptr(new ExtraCustomABI(F, S)); + return std::make_unique(F, S); }; CGSCCPassManager CGPM;