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

Classes

struct  LowererBase
 
struct  Shape
 

Enumerations

enum class  ABI { Switch , Retcon , RetconOnce , 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< Argument *, AllocaInst *, 4 > &ArgToAllocaMap, DbgVariableIntrinsic *DVI, bool OptimizeFrame)
 Attempts to rewrite the location operand of debug intrinsics in terms of the coroutine frame pointer, folding pointer offsets into the DIExpression of the intrinsic.
 
bool defaultMaterializable (Instruction &V)
 Default materializable callback.
 
void buildCoroutineFrame (Function &F, Shape &Shape, const std::function< bool(Instruction &)> &MaterializableCallback)
 
CallInstcreateMustTailCall (DebugLoc Loc, Function *MustTailCallFn, ArrayRef< Value * > Arguments, IRBuilder<> &)
 

Enumeration Type Documentation

◆ ABI

enum class 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 49 of file CoroInternal.h.

Function Documentation

◆ buildCoroutineFrame()

void llvm::coro::buildCoroutineFrame ( Function F,
Shape Shape,
const std::function< bool(Instruction &)> &  MaterializableCallback 
)

◆ 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 Name.

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

◆ declaresIntrinsics()

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

◆ defaultMaterializable()

bool llvm::coro::defaultMaterializable ( Instruction V)

Default materializable callback.

Definition at line 2245 of file CoroFrame.cpp.

◆ replaceCoroFree()

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

◆ salvageDebugInfo()

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