clang 20.0.0git
Classes | Functions
CGCoroutine.cpp File Reference
#include "CGCleanup.h"
#include "CodeGenFunction.h"
#include "llvm/ADT/ScopeExit.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtVisitor.h"

Go to the source code of this file.

Classes

struct  clang::CodeGen::CGCoroData
 

Functions

static void createCoroData (CodeGenFunction &CGF, CodeGenFunction::CGCoroInfo &CurCoro, llvm::CallInst *CoroId, CallExpr const *CoroIdExpr=nullptr)
 
static SmallString< 32 > buildSuspendPrefixStr (CGCoroData &Coro, AwaitKind Kind)
 
static bool FunctionCanThrow (const FunctionDecl *D)
 
static bool StmtCanThrow (const Stmt *S)
 
static LValueOrRValue emitSuspendExpression (CodeGenFunction &CGF, CGCoroData &Coro, CoroutineSuspendExpr const &S, AwaitKind Kind, AggValueSlot aggSlot, bool ignoreResult, bool forLValue)
 
static QualType getCoroutineSuspendExprReturnType (const ASTContext &Ctx, const CoroutineSuspendExpr *E)
 
static SmallVector< llvm::OperandBundleDef, 1 > getBundlesForCoroEnd (CodeGenFunction &CGF)
 
static void emitBodyAndFallthrough (CodeGenFunction &CGF, const CoroutineBodyStmt &S, Stmt *Body)
 

Function Documentation

◆ buildSuspendPrefixStr()

static SmallString< 32 > buildSuspendPrefixStr ( CGCoroData Coro,
AwaitKind  Kind 
)
static

◆ createCoroData()

static void createCoroData ( CodeGenFunction CGF,
CodeGenFunction::CGCoroInfo &  CurCoro,
llvm::CallInst *  CoroId,
CallExpr const *  CoroIdExpr = nullptr 
)
static

◆ emitBodyAndFallthrough()

static void emitBodyAndFallthrough ( CodeGenFunction CGF,
const CoroutineBodyStmt S,
Stmt Body 
)
static

◆ emitSuspendExpression()

static LValueOrRValue emitSuspendExpression ( CodeGenFunction CGF,
CGCoroData Coro,
CoroutineSuspendExpr const &  S,
AwaitKind  Kind,
AggValueSlot  aggSlot,
bool  ignoreResult,
bool  forLValue 
)
static

Definition at line 222 of file CGCoroutine.cpp.

References clang::CodeGen::CodeGenFunction::OpaqueValueMappingData::bind(), clang::CodeGen::CodeGenFunction::Builder, buildSuspendPrefixStr(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGCoroData::CleanupJD, clang::CompoundStmt::Create(), clang::CXXTryStmt::Create(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateFlagStore(), clang::CodeGen::CodeGenFunction::CreateTempAlloca(), clang::CodeGen::CodeGenFunction::CurCoro, clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::CodeGenFunction::CGCoroInfo::Data, E, clang::CodeGen::CodeGenFunction::EmitAnyExpr(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::CodeGenFunction::EmitBranchThroughCleanup(), clang::CodeGen::CodeGenFunction::EmitCallOrInvoke(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitNounwindRuntimeCall(), clang::CodeGen::CodeGenFunction::EmitStmt(), clang::CodeGen::CodeGenFunction::EnterCXXTryStmt(), clang::CodeGen::CGCoroData::ExceptionHandler, clang::CodeGen::CodeGenFunction::ExitCXXTryStmt(), clang::CodeGen::CodeGenFunction::generateAwaitSuspendWrapper(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::RValue::getIgnored(), clang::CodeGen::CodeGenModule::getIntrinsic(), clang::CodeGen::CodeGenFunction::getOrCreateOpaqueLValueMapping(), clang::CodeGen::LValue::getPointer(), clang::CodeGen::CodeGenFunction::CGCoroInfo::InSuspendBlock, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, Loc, clang::CodeGen::CGCoroData::ResumeEHVar, StmtCanThrow(), clang::CodeGen::CGCoroData::SuspendBB, clang::CoroutineSuspendExpr::SuspendBool, clang::CoroutineSuspendExpr::SuspendHandle, clang::CoroutineSuspendExpr::SuspendVoid, and clang::Switch.

◆ FunctionCanThrow()

static bool FunctionCanThrow ( const FunctionDecl D)
static

Definition at line 134 of file CGCoroutine.cpp.

References clang::CT_Cannot, D, and clang::isNoexceptExceptionSpec().

Referenced by StmtCanThrow().

◆ getBundlesForCoroEnd()

static SmallVector< llvm::OperandBundleDef, 1 > getBundlesForCoroEnd ( CodeGenFunction CGF)
static

◆ getCoroutineSuspendExprReturnType()

static QualType getCoroutineSuspendExprReturnType ( const ASTContext Ctx,
const CoroutineSuspendExpr E 
)
static

Definition at line 403 of file CGCoroutine.cpp.

References E.

◆ StmtCanThrow()

static bool StmtCanThrow ( const Stmt S)
static

Definition at line 144 of file CGCoroutine.cpp.

References FunctionCanThrow(), and StmtCanThrow().

Referenced by emitSuspendExpression(), and StmtCanThrow().