1 //===-- Coroutines.h - Coroutine Transformations ----------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // Declare accessor functions for coroutine lowering passes. 10 //===----------------------------------------------------------------------===// 11 12 #ifndef LLVM_TRANSFORMS_COROUTINES_H 13 #define LLVM_TRANSFORMS_COROUTINES_H 14 15 namespace llvm { 16 17 class Pass; 18 class PassManagerBuilder; 19 20 /// Add all coroutine passes to appropriate extension points. 21 void addCoroutinePassesToExtensionPoints(PassManagerBuilder &Builder); 22 23 /// Lower coroutine intrinsics that are not needed by later passes. 24 Pass *createCoroEarlyPass(); 25 26 /// Split up coroutines into multiple functions driving their state machines. 27 Pass *createCoroSplitPass(); 28 29 /// Analyze coroutines use sites, devirtualize resume/destroy calls and elide 30 /// heap allocation for coroutine frame where possible. 31 Pass *createCoroElidePass(); 32 33 /// Lower all remaining coroutine intrinsics. 34 Pass *createCoroCleanupPass(); 35 36 } 37 38 #endif 39