LLVM 19.0.0git
CoroSplit.h
Go to the documentation of this file.
1//===- CoroSplit.h - Converts a coroutine into a state machine -*- C++ -*--===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// \file
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.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_TRANSFORMS_COROUTINES_COROSPLIT_H
16#define LLVM_TRANSFORMS_COROUTINES_COROSPLIT_H
17
20#include "llvm/IR/PassManager.h"
21
22namespace llvm {
23
24struct CoroSplitPass : PassInfoMixin<CoroSplitPass> {
25 const std::function<bool(Instruction &)> MaterializableCallback;
26
27 CoroSplitPass(bool OptimizeFrame = false);
29 bool OptimizeFrame = false)
32
35 static bool isRequired() { return true; }
36
37 // Would be true if the Optimization level isn't O0.
39};
40} // end namespace llvm
41
42#endif // LLVM_TRANSFORMS_COROUTINES_COROSPLIT_H
This header provides classes for managing passes over SCCs of the call graph.
Implements a lazy call graph analysis and related passes for the new pass manager.
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:321
An SCC of the call graph.
A lazily constructed view of the call graph of a module.
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:109
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
CoroSplitPass(std::function< bool(Instruction &)> MaterializableCallback, bool OptimizeFrame=false)
Definition: CoroSplit.h:28
const std::function< bool(Instruction &)> MaterializableCallback
Definition: CoroSplit.h:25
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR)
Definition: CoroSplit.cpp:2215
static bool isRequired()
Definition: CoroSplit.h:35
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:74