Coroutines.h revision 360784
1//===-- Coroutines.h - Coroutine Transformations ----------------*- 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// Declare accessor functions for coroutine lowering passes.
9//===----------------------------------------------------------------------===//
10
11#ifndef LLVM_TRANSFORMS_COROUTINES_H
12#define LLVM_TRANSFORMS_COROUTINES_H
13
14namespace llvm {
15
16class Pass;
17class PassManagerBuilder;
18
19/// Add all coroutine passes to appropriate extension points.
20void addCoroutinePassesToExtensionPoints(PassManagerBuilder &Builder);
21
22/// Lower coroutine intrinsics that are not needed by later passes.
23Pass *createCoroEarlyLegacyPass();
24
25/// Split up coroutines into multiple functions driving their state machines.
26Pass *createCoroSplitLegacyPass();
27
28/// Analyze coroutines use sites, devirtualize resume/destroy calls and elide
29/// heap allocation for coroutine frame where possible.
30Pass *createCoroElideLegacyPass();
31
32/// Lower all remaining coroutine intrinsics.
33Pass *createCoroCleanupLegacyPass();
34
35}
36
37#endif
38