clang 22.0.0git
CGCoroutine.cpp File Reference
#include "CGCleanup.h"
#include "CGDebugInfo.h"
#include "CodeGenFunction.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtVisitor.h"
#include "llvm/ADT/ScopeExit.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()

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

◆ createCoroData()

◆ emitBodyAndFallthrough()

◆ emitSuspendExpression()

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

Definition at line 223 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::CodeGenFunction::CreateTempAlloca(), clang::CodeGen::CodeGenFunction::CurCoro, clang::CodeGen::CodeGenFunction::CurFn, clang::CodeGen::CodeGenFunction::CGCoroInfo::Data, 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::CoroutineSuspendExpr::getCommonExpr(), clang::CodeGen::CodeGenFunction::getContext(), clang::Expr::getExprLoc(), clang::CodeGen::RValue::getIgnored(), clang::CodeGen::CodeGenModule::getIntrinsic(), clang::CoroutineSuspendExpr::getOpaqueValue(), clang::CodeGen::CodeGenFunction::getOrCreateOpaqueLValueMapping(), clang::CodeGen::LValue::getPointer(), clang::CoroutineSuspendExpr::getReadyExpr(), clang::CoroutineSuspendExpr::getResumeExpr(), clang::CoroutineSuspendExpr::getSuspendExpr(), clang::CoroutineSuspendExpr::getSuspendReturnType(), clang::CodeGen::CodeGenFunction::CGCoroInfo::InSuspendBlock, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CGCoroData::ResumeEHVar, StmtCanThrow(), clang::CodeGen::CGCoroData::SuspendBB, clang::CoroutineSuspendExpr::SuspendBool, clang::CoroutineSuspendExpr::SuspendHandle, clang::CoroutineSuspendExpr::SuspendVoid, and clang::Switch.

Referenced by clang::CodeGen::CodeGenFunction::EmitCoawaitExpr(), clang::CodeGen::CodeGenFunction::EmitCoawaitLValue(), clang::CodeGen::CodeGenFunction::EmitCoyieldExpr(), and clang::CodeGen::CodeGenFunction::EmitCoyieldLValue().

◆ FunctionCanThrow()

bool FunctionCanThrow ( const FunctionDecl * D)
static

◆ getBundlesForCoroEnd()

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

◆ getCoroutineSuspendExprReturnType()

◆ StmtCanThrow()

bool StmtCanThrow ( const Stmt * S)
static

Definition at line 145 of file CGCoroutine.cpp.

References clang::Stmt::children(), FunctionCanThrow(), and StmtCanThrow().

Referenced by emitSuspendExpression(), and StmtCanThrow().