1 //===- CoroConditionalWrapper.cpp -----------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm/Transforms/Coroutines/CoroConditionalWrapper.h"
10 #include "CoroInternal.h"
11 #include "llvm/IR/Module.h"
15 CoroConditionalWrapper::CoroConditionalWrapper(ModulePassManager
&&PM
)
16 : PM(std::move(PM
)) {}
18 PreservedAnalyses
CoroConditionalWrapper::run(Module
&M
,
19 ModuleAnalysisManager
&AM
) {
20 if (!coro::declaresAnyIntrinsic(M
))
21 return PreservedAnalyses::all();
26 void CoroConditionalWrapper::printPipeline(
27 raw_ostream
&OS
, function_ref
<StringRef(StringRef
)> MapClassName2PassName
) {
30 PM
.printPipeline(OS
, MapClassName2PassName
);