class CoroutineStmtBuilder

Declaration

class CoroutineStmtBuilder : public CtorArgs { /* full declaration omitted */ };

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:24

Inherits from: CoroutineBodyStmt::CtorArgs

Member Variables

private clang::Sema& S
private clang::FunctionDecl& FD
private sema::FunctionScopeInfo& Fn
private bool IsValid = true
private clang::SourceLocation Loc
private SmallVector<clang::Stmt*, 4> ParamMovesVector
private const bool IsPromiseDependentType
private clang::CXXRecordDecl* PromiseRecordDecl = nullptr

Inherited from CoroutineBodyStmt::CtorArgs:

public Body = nullptr
public Promise = nullptr
public InitialSuspend = nullptr
public FinalSuspend = nullptr
public OnException = nullptr
public OnFallthrough = nullptr
public Allocate = nullptr
public Deallocate = nullptr
public ReturnValue = nullptr
public ReturnStmt = nullptr
public ReturnStmtOnAllocFailure = nullptr
public ParamMoves

Method Overview

Methods

CoroutineStmtBuilder(clang::Sema& S,
                     clang::FunctionDecl& FD,
                     sema::FunctionScopeInfo& Fn,
                     clang::Stmt* Body)

Description

Construct a CoroutineStmtBuilder and initialize the promise statement and initial/final suspends from the FunctionScopeInfo.

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:37

Parameters

clang::Sema& S
clang::FunctionDecl& FD
sema::FunctionScopeInfo& Fn
clang::Stmt* Body

bool buildDependentStatements()

Description

Build the coroutine body statements that require a non-dependent promise type in order to construct. For example different new/delete overloads are selected depending on if the promise type provides `unhandled_exception()`, and therefore they cannot be built until the promise type is complete so that we can perform name lookup.

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:51

bool buildStatements()

Description

Build the coroutine body statements, including the "promise dependent" statements when the promise type is not dependent.

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:42

bool isInvalid() const

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:53

bool makeGroDeclAndReturnStmt()

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:62

bool makeInitialAndFinalSuspend()

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:57

bool makeNewAndDeleteExpr()

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:58

bool makeOnException()

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:60

bool makeOnFallthrough()

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:59

bool makePromiseStmt()

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:56

bool makeReturnObject()

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:61

bool makeReturnOnAllocFailure()

Declared at: clang/lib/Sema/CoroutineStmtBuilder.h:63