diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -554,7 +554,8 @@ detail::PassModel; - Passes.emplace_back(new PassModelT(std::forward(Pass))); + Passes.push_back(std::unique_ptr( + new PassModelT(std::forward(Pass)))); } /// When adding a pass manager pass that has the same type as this pass @@ -566,7 +567,7 @@ std::enable_if_t::value> addPass(PassT &&Pass) { for (auto &P : Pass.Passes) - Passes.emplace_back(std::move(P)); + Passes.push_back(std::move(P)); } /// Returns if the pass manager contains any passes. diff --git a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h --- a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h @@ -109,7 +109,8 @@ detail::PassModel; IsLoopNestPass.push_back(false); - LoopPasses.emplace_back(new LoopPassModelT(std::forward(Pass))); + LoopPasses.push_back(std::unique_ptr( + new LoopPassModelT(std::forward(Pass)))); } template @@ -120,8 +121,8 @@ LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater &>; IsLoopNestPass.push_back(true); - LoopNestPasses.emplace_back( - new LoopNestPassModelT(std::forward(Pass))); + LoopNestPasses.push_back(std::unique_ptr( + new LoopNestPassModelT(std::forward(Pass)))); } // Specializations of `addPass` for `RepeatedPass`. These are necessary since @@ -135,7 +136,8 @@ LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater &>; IsLoopNestPass.push_back(false); - LoopPasses.emplace_back(new RepeatedLoopPassModelT(std::move(Pass))); + LoopPasses.push_back(std::unique_ptr( + new RepeatedLoopPassModelT(std::move(Pass)))); } template @@ -146,8 +148,8 @@ LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater &>; IsLoopNestPass.push_back(true); - LoopNestPasses.emplace_back( - new RepeatedLoopNestPassModelT(std::move(Pass))); + LoopNestPasses.push_back(std::unique_ptr( + new RepeatedLoopNestPassModelT(std::move(Pass)))); } bool isEmpty() const { return LoopPasses.empty() && LoopNestPasses.empty(); }