2016-07-28 23:04:31 +02:00
|
|
|
//===-- Coroutines.h - Coroutine Transformations ----------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2016-07-28 23:04:31 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Declare accessor functions for coroutine lowering passes.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TRANSFORMS_COROUTINES_H
|
|
|
|
#define LLVM_TRANSFORMS_COROUTINES_H
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class Pass;
|
|
|
|
class PassManagerBuilder;
|
|
|
|
|
|
|
|
/// Add all coroutine passes to appropriate extension points.
|
|
|
|
void addCoroutinePassesToExtensionPoints(PassManagerBuilder &Builder);
|
|
|
|
|
|
|
|
/// Lower coroutine intrinsics that are not needed by later passes.
|
2020-01-02 02:07:34 +01:00
|
|
|
Pass *createCoroEarlyLegacyPass();
|
2016-07-28 23:04:31 +02:00
|
|
|
|
|
|
|
/// Split up coroutines into multiple functions driving their state machines.
|
2021-03-31 04:34:55 +02:00
|
|
|
Pass *createCoroSplitLegacyPass(bool IsOptimizing = false);
|
2016-07-28 23:04:31 +02:00
|
|
|
|
|
|
|
/// Analyze coroutines use sites, devirtualize resume/destroy calls and elide
|
|
|
|
/// heap allocation for coroutine frame where possible.
|
2020-01-02 02:07:34 +01:00
|
|
|
Pass *createCoroElideLegacyPass();
|
2016-07-28 23:04:31 +02:00
|
|
|
|
|
|
|
/// Lower all remaining coroutine intrinsics.
|
2020-01-02 02:07:34 +01:00
|
|
|
Pass *createCoroCleanupLegacyPass();
|
2016-07-28 23:04:31 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|