1 //===- CoroSplit.h - Converts a coroutine into a state machine -*- C++ -*--===//
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 //===----------------------------------------------------------------------===//
10 // This file declares the pass that builds the coroutine frame and outlines
11 // the resume and destroy parts of the coroutine into separate functions.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_TRANSFORMS_COROUTINES_COROSPLIT_H
16 #define LLVM_TRANSFORMS_COROUTINES_COROSPLIT_H
18 #include "llvm/Analysis/CGSCCPassManager.h"
19 #include "llvm/Analysis/LazyCallGraph.h"
20 #include "llvm/IR/PassManager.h"
24 struct CoroSplitPass : PassInfoMixin<CoroSplitPass> {
25 CoroSplitPass(bool OptimizeFrame = false) : OptimizeFrame(OptimizeFrame) {}
27 PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
28 LazyCallGraph &CG, CGSCCUpdateResult &UR);
29 static bool isRequired() { return true; }
31 // Would be true if the Optimization level isn't O0.
34 } // end namespace llvm
36 #endif // LLVM_TRANSFORMS_COROUTINES_COROSPLIT_H