LLVM  15.0.0git
Classes | Enumerations | Functions
llvm::coro Namespace Reference

Classes

struct  LowererBase
 
struct  Shape
 

Enumerations

enum  ABI { ABI::Switch, ABI::Retcon, ABI::RetconOnce, ABI::Async }
 

Functions

bool declaresAnyIntrinsic (const Module &M)
 
bool declaresIntrinsics (const Module &M, const std::initializer_list< StringRef >)
 
void replaceCoroFree (CoroIdInst *CoroId, bool Elide)
 
void salvageDebugInfo (SmallDenseMap< llvm::Value *, llvm::AllocaInst *, 4 > &DbgPtrAllocaCache, DbgVariableIntrinsic *DVI, bool OptimizeFrame)
 Recover a dbg.declare prepared by the frontend and emit an alloca holding a pointer to the coroutine frame. More...
 
void buildCoroutineFrame (Function &F, Shape &Shape)
 
CallInstcreateMustTailCall (DebugLoc Loc, Function *MustTailCallFn, ArrayRef< Value * > Arguments, IRBuilder<> &)
 

Enumeration Type Documentation

◆ ABI

enum llvm::coro::ABI
strong
Enumerator
Switch 

The "resume-switch" lowering, where there are separate resume and destroy functions that are shared between all suspend points.

The coroutine frame implicitly stores the resume and destroy functions, the current index, and any promise value.

Retcon 

The "returned-continuation" lowering, where each suspend point creates a single continuation function that is used for both resuming and destroying.

Does not support promises.

RetconOnce 

The "unique returned-continuation" lowering, where each suspend point creates a single continuation function that is used for both resuming and destroying.

Does not support promises. The function is known to suspend at most once during its execution, and the return value of the continuation is void.

Async 

The "async continuation" lowering, where each suspend point creates a single continuation function.

The continuation function is available as an intrinsic.

Definition at line 48 of file CoroInternal.h.

Function Documentation

◆ buildCoroutineFrame()

void llvm::coro::buildCoroutineFrame ( Function F,
Shape Shape 
)

◆ createMustTailCall()

CallInst * llvm::coro::createMustTailCall ( DebugLoc  Loc,
Function MustTailCallFn,
ArrayRef< Value * >  Arguments,
IRBuilder<> &  Builder 
)

◆ declaresAnyIntrinsic()

bool llvm::coro::declaresAnyIntrinsic ( const Module M)

Definition at line 105 of file Coroutines.cpp.

References assert(), CoroIntrinsics, isCoroutineIntrinsicName(), and M.

Referenced by llvm::CoroConditionalWrapper::run().

◆ declaresIntrinsics()

bool llvm::coro::declaresIntrinsics ( const Module M,
const std::initializer_list< StringRef List 
)

◆ replaceCoroFree()

void llvm::coro::replaceCoroFree ( CoroIdInst CoroId,
bool  Elide 
)

◆ salvageDebugInfo()

void llvm::coro::salvageDebugInfo ( SmallDenseMap< llvm::Value *, llvm::AllocaInst *, 4 > &  DbgPtrAllocaCache,
DbgVariableIntrinsic DVI,
bool  OptimizeFrame 
)