LLVM  10.0.0svn
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  RetconLoweringStorage
 
struct  SwitchFieldIndex
 
struct  SwitchLoweringStorage
 

Public Member Functions

CoroIdInstgetSwitchCoroId () const
 
AnyCoroIdRetconInstgetRetconCoroId () const
 
IntegerTypegetIndexType () const
 
ConstantIntgetIndex (uint64_t Value) const
 
PointerTypegetSwitchResumePointerType () const
 
FunctionTypegetResumeFunctionType () const
 
ArrayRef< Type * > getRetconResultTypes () const
 
ArrayRef< Type * > getRetconResumeTypes () const
 
CallingConv::ID getResumeFunctionCC () const
 
unsigned getFirstSpillFieldIndex () 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)
 
void buildFrom (Function &F)
 

Public Attributes

CoroBeginInstCoroBegin
 
SmallVector< CoroEndInst *, 4 > CoroEnds
 
SmallVector< CoroSizeInst *, 2 > CoroSizes
 
SmallVector< AnyCoroSuspendInst *, 4 > CoroSuspends
 
SmallVector< CallInst *, 2 > SwiftErrorOps
 
coro::ABI ABI
 
StructTypeFrameTy
 
InstructionFramePtr
 
BasicBlockAllocaSpillBlock
 
union {
   SwitchLoweringStorage   SwitchLowering
 
   RetconLoweringStorage   RetconLowering
 
}; 
 

Detailed Description

Definition at line 87 of file CoroInternal.h.

Constructor & Destructor Documentation

◆ Shape() [1/2]

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

◆ Shape() [2/2]

llvm::coro::Shape::Shape ( Function F)
inlineexplicit

Definition at line 234 of file CoroInternal.h.

References llvm::coro::buildCoroutineFrame(), and 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 498 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 519 of file Coroutines.cpp.

References addCallToCallGraph(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateCall(), LLVM_ATTRIBUTE_NORETURN, llvm_unreachable, propagateCallAttrsFromCallee(), llvm::coro::Retcon, llvm::coro::RetconOnce, and llvm::coro::Switch.

Referenced by maybeFreeRetconStorage().

◆ getFirstSpillFieldIndex()

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

◆ getIndex()

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

Definition at line 148 of file CoroInternal.h.

References llvm::ConstantInt::get().

Referenced by createResumeEntryBlock().

◆ getIndexType()

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

Definition at line 143 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 217 of file CoroInternal.h.

References Size, and llvm::coro::Switch.

Referenced by buildFrameType(), and insertSpills().

◆ 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 184 of file CoroInternal.h.

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

◆ getSwitchCoroId()

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

◆ getSwitchResumePointerType()

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

Definition at line 152 of file CoroInternal.h.

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

Member Data Documentation

◆ @544

union { ... }

◆ ABI

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

◆ AllocaSpillBlock

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

Definition at line 110 of file CoroInternal.h.

Referenced by clear(), and insertSpills().

◆ CoroBegin

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

◆ CoroEnds

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

Definition at line 89 of file CoroInternal.h.

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

◆ CoroSizes

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

Definition at line 90 of file CoroInternal.h.

Referenced by clear(), and replaceFrameSize().

◆ CoroSuspends

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

◆ FramePtr

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

◆ FrameTy

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

◆ RetconLowering

RetconLoweringStorage llvm::coro::Shape::RetconLowering

Definition at line 129 of file CoroInternal.h.

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

◆ SwiftErrorOps

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

◆ SwitchLowering

SwitchLoweringStorage llvm::coro::Shape::SwitchLowering

Definition at line 128 of file CoroInternal.h.

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


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