1 //===-- Coroutines.h - Coroutine Transformations ----------------*- 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 //===----------------------------------------------------------------------===//
8 // Declare accessor functions for coroutine lowering passes.
9 //===----------------------------------------------------------------------===//
11 #ifndef LLVM_TRANSFORMS_COROUTINES_H
12 #define LLVM_TRANSFORMS_COROUTINES_H
17 class PassManagerBuilder
;
19 /// Add all coroutine passes to appropriate extension points.
20 void addCoroutinePassesToExtensionPoints(PassManagerBuilder
&Builder
);
22 /// Lower coroutine intrinsics that are not needed by later passes.
23 Pass
*createCoroEarlyPass();
25 /// Split up coroutines into multiple functions driving their state machines.
26 Pass
*createCoroSplitPass();
28 /// Analyze coroutines use sites, devirtualize resume/destroy calls and elide
29 /// heap allocation for coroutine frame where possible.
30 Pass
*createCoroElidePass();
32 /// Lower all remaining coroutine intrinsics.
33 Pass
*createCoroCleanupPass();