LLVM  13.0.0git
Classes | Public Member Functions | Public Attributes | List of all members
llvm::coro::Shape Struct Reference

#include "Transforms/Coroutines/CoroInternal.h"

Collaboration diagram for llvm::coro::Shape:
Collaboration graph
[legend]

Classes

struct  AsyncLoweringStorage
 
struct  RetconLoweringStorage
 
struct  SwitchFieldIndex
 
struct  SwitchLoweringStorage
 

Public Member Functions

CoroIdInstgetSwitchCoroId () const
 
AnyCoroIdRetconInstgetRetconCoroId () const
 
CoroIdAsyncInstgetAsyncCoroId () const
 
unsigned getSwitchIndexField () const
 
IntegerTypegetIndexType () const
 
ConstantIntgetIndex (uint64_t Value) const
 
PointerTypegetSwitchResumePointerType () const
 
FunctionTypegetResumeFunctionType () const
 
ArrayRef< Type * > getRetconResultTypes () const
 
ArrayRef< Type * > getRetconResumeTypes () const
 
CallingConv::ID getResumeFunctionCC () const
 
AllocaInstgetPromiseAlloca () const
 
ValueemitAlloc (IRBuilder<> &Builder, Value *Size, CallGraph *CG) const
 Allocate memory according to the rules of the active lowering. More...
 
void emitDealloc (IRBuilder<> &Builder, Value *Ptr, CallGraph *CG) const
 Deallocate memory according to the rules of the active lowering. More...
 
 Shape ()=default
 
 Shape (Function &F, bool ReuseFrameSlot=false)
 
void buildFrom (Function &F)
 

Public Attributes

CoroBeginInstCoroBegin
 
SmallVector< AnyCoroEndInst *, 4 > CoroEnds
 
SmallVector< CoroSizeInst *, 2 > CoroSizes
 
SmallVector< AnyCoroSuspendInst *, 4 > CoroSuspends
 
SmallVector< CallInst *, 2 > SwiftErrorOps
 
coro::ABI ABI
 
StructTypeFrameTy
 
Align FrameAlign
 
uint64_t FrameSize
 
InstructionFramePtr
 
BasicBlockAllocaSpillBlock
 
bool ReuseFrameSlot
 This would only be true if optimization are enabled. More...
 
union {
   SwitchLoweringStorage   SwitchLowering
 
   RetconLoweringStorage   RetconLowering
 
   AsyncLoweringStorage   AsyncLowering
 
}; 
 

Detailed Description

Definition at line 98 of file CoroInternal.h.

Constructor & Destructor Documentation

◆ Shape() [1/2]

llvm::coro::Shape::Shape ( )
default

◆ Shape() [2/2]

llvm::coro::Shape::Shape ( Function F,
bool  ReuseFrameSlot = false 
)
inlineexplicit

Definition at line 275 of file CoroInternal.h.

References F.

Member Function Documentation

◆ buildFrom()

void coro::Shape::buildFrom ( Function F)

◆ emitAlloc()

Value * coro::Shape::emitAlloc ( IRBuilder<> &  Builder,
Value Size,
CallGraph CG 
) const

Allocate memory according to the rules of the active lowering.

Parameters
CG- if non-null, will be updated for the new call

Definition at line 529 of file Coroutines.cpp.

References llvm_unreachable, llvm::coro::Retcon, llvm::coro::RetconOnce, and llvm::coro::Switch.

Referenced by splitRetconCoroutine().

◆ emitDealloc()

void coro::Shape::emitDealloc ( IRBuilder<> &  Builder,
Value Ptr,
CallGraph CG 
) const

Deallocate memory according to the rules of the active lowering.

Parameters
CG- if non-null, will be updated for the new call

Definition at line 552 of file Coroutines.cpp.

References addCallToCallGraph(), llvm::coro::Async, Builder, llvm_unreachable, propagateCallAttrsFromCallee(), llvm::coro::Retcon, llvm::coro::RetconOnce, and llvm::coro::Switch.

Referenced by maybeFreeRetconStorage().

◆ getAsyncCoroId()

CoroIdAsyncInst* llvm::coro::Shape::getAsyncCoroId ( ) const
inline

Definition at line 180 of file CoroInternal.h.

References assert(), llvm::coro::Async, and llvm::CoroBeginInst::getId().

◆ getIndex()

ConstantInt* llvm::coro::Shape::getIndex ( uint64_t  Value) const
inline

Definition at line 195 of file CoroInternal.h.

References llvm::ConstantInt::get().

Referenced by createResumeEntryBlock().

◆ getIndexType()

IntegerType* llvm::coro::Shape::getIndexType ( ) const
inline

Definition at line 190 of file CoroInternal.h.

References assert(), llvm::StructType::getElementType(), and llvm::coro::Switch.

Referenced by createResumeEntryBlock().

◆ getPromiseAlloca()

AllocaInst* llvm::coro::Shape::getPromiseAlloca ( ) const
inline

Definition at line 258 of file CoroInternal.h.

References llvm::coro::Switch.

Referenced by buildFrameDebugInfo(), and buildFrameType().

◆ getResumeFunctionCC()

CallingConv::ID llvm::coro::Shape::getResumeFunctionCC ( ) const
inline

◆ getResumeFunctionType()

FunctionType* llvm::coro::Shape::getResumeFunctionType ( ) const
inline

◆ getRetconCoroId()

AnyCoroIdRetconInst* llvm::coro::Shape::getRetconCoroId ( ) const
inline

◆ getRetconResultTypes()

ArrayRef<Type*> llvm::coro::Shape::getRetconResultTypes ( ) const
inline

◆ getRetconResumeTypes()

ArrayRef<Type*> llvm::coro::Shape::getRetconResumeTypes ( ) const
inline

Definition at line 235 of file CoroInternal.h.

References assert(), llvm::coro::Retcon, and llvm::coro::RetconOnce.

◆ getSwitchCoroId()

CoroIdInst* llvm::coro::Shape::getSwitchCoroId ( ) const
inline

◆ getSwitchIndexField()

unsigned llvm::coro::Shape::getSwitchIndexField ( ) const
inline

Definition at line 185 of file CoroInternal.h.

References assert(), and llvm::coro::Switch.

Referenced by createResumeEntryBlock().

◆ getSwitchResumePointerType()

PointerType* llvm::coro::Shape::getSwitchResumePointerType ( ) const
inline

Definition at line 199 of file CoroInternal.h.

References assert(), llvm::StructType::getElementType(), and llvm::coro::Switch.

Member Data Documentation

◆ @584

union { ... }

◆ ABI

coro::ABI llvm::coro::Shape::ABI

◆ AllocaSpillBlock

BasicBlock* llvm::coro::Shape::AllocaSpillBlock

Definition at line 126 of file CoroInternal.h.

Referenced by clear(), and insertSpills().

◆ AsyncLowering

AsyncLoweringStorage llvm::coro::Shape::AsyncLowering

◆ CoroBegin

CoroBeginInst* llvm::coro::Shape::CoroBegin

◆ CoroEnds

SmallVector<AnyCoroEndInst *, 4> llvm::coro::Shape::CoroEnds

Definition at line 100 of file CoroInternal.h.

Referenced by llvm::coro::buildCoroutineFrame(), and clear().

◆ CoroSizes

SmallVector<CoroSizeInst *, 2> llvm::coro::Shape::CoroSizes

Definition at line 101 of file CoroInternal.h.

Referenced by clear(), and replaceFrameSize().

◆ CoroSuspends

SmallVector<AnyCoroSuspendInst *, 4> llvm::coro::Shape::CoroSuspends

◆ FrameAlign

Align llvm::coro::Shape::FrameAlign

Definition at line 123 of file CoroInternal.h.

Referenced by buildFrameDebugInfo(), buildFrameType(), and handleNoSuspendCoroutine().

◆ FramePtr

Instruction* llvm::coro::Shape::FramePtr

◆ FrameSize

uint64_t llvm::coro::Shape::FrameSize

Definition at line 124 of file CoroInternal.h.

Referenced by buildFrameDebugInfo(), and buildFrameType().

◆ FrameTy

StructType* llvm::coro::Shape::FrameTy

◆ RetconLowering

RetconLoweringStorage llvm::coro::Shape::RetconLowering

Definition at line 165 of file CoroInternal.h.

Referenced by buildFrameType(), maybeFreeRetconStorage(), and splitRetconCoroutine().

◆ ReuseFrameSlot

bool llvm::coro::Shape::ReuseFrameSlot

This would only be true if optimization are enabled.

Definition at line 129 of file CoroInternal.h.

Referenced by insertSpills().

◆ SwiftErrorOps

SmallVector<CallInst*, 2> llvm::coro::Shape::SwiftErrorOps

◆ SwitchLowering

SwitchLoweringStorage llvm::coro::Shape::SwitchLowering

The documentation for this struct was generated from the following files: