|
static LookupResult | lookupMember (Sema &S, const char *Name, CXXRecordDecl *RD, SourceLocation Loc, bool &Res) |
|
static bool | lookupMember (Sema &S, const char *Name, CXXRecordDecl *RD, SourceLocation Loc) |
|
static QualType | lookupPromiseType (Sema &S, const FunctionDecl *FD, SourceLocation KwLoc) |
| Look up the std::coroutine_traits<...>::promise_type for the given function type. More...
|
|
static QualType | lookupCoroutineHandleType (Sema &S, QualType PromiseType, SourceLocation Loc) |
| Look up the std::coroutine_handle<PromiseType>. More...
|
|
static bool | isValidCoroutineContext (Sema &S, SourceLocation Loc, StringRef Keyword) |
|
static ExprResult | buildOperatorCoawaitCall (Sema &SemaRef, Scope *S, SourceLocation Loc, Expr *E) |
|
static ExprResult | buildCoroutineHandle (Sema &S, QualType PromiseType, SourceLocation Loc) |
|
static ExprResult | buildMemberCall (Sema &S, Expr *Base, SourceLocation Loc, StringRef Name, MultiExprArg Args) |
|
static Expr * | maybeTailCall (Sema &S, QualType RetType, Expr *E, SourceLocation Loc) |
|
static ReadySuspendResumeResult | buildCoawaitCalls (Sema &S, VarDecl *CoroPromise, SourceLocation Loc, Expr *E) |
| Build calls to await_ready, await_suspend, and await_resume for a co_await expression. More...
|
|
static ExprResult | buildPromiseCall (Sema &S, VarDecl *Promise, SourceLocation Loc, StringRef Name, MultiExprArg Args) |
|
static FunctionScopeInfo * | checkCoroutineContext (Sema &S, SourceLocation Loc, StringRef Keyword, bool IsImplicit=false) |
| Check that this is a context in which a coroutine suspension can appear. More...
|
|
static void | checkNoThrow (Sema &S, const Stmt *E, llvm::SmallPtrSetImpl< const Decl * > &ThrowingDecls) |
| Recursively check E and all its children to see if any call target (including constructor call) is declared noexcept. More...
|
|
static bool | isWithinCatchScope (Scope *S) |
|
static bool | checkSuspensionContext (Sema &S, SourceLocation Loc, StringRef Keyword) |
|
static Expr * | buildStdNoThrowDeclRef (Sema &S, SourceLocation Loc) |
| Look up the std::nothrow object. More...
|
|
static TypeSourceInfo * | getTypeSourceInfoForStdAlignValT (Sema &S, SourceLocation Loc) |
|
static bool | findDeleteForPromise (Sema &S, SourceLocation Loc, QualType PromiseType, FunctionDecl *&OperatorDelete) |
|
static CompoundStmt * | buildCoroutineBody (Stmt *Body, ASTContext &Context) |
|
static bool | diagReturnOnAllocFailure (Sema &S, Expr *E, CXXRecordDecl *PromiseRecordDecl, FunctionScopeInfo &Fn) |
|
static bool | collectPlacementArgs (Sema &S, FunctionDecl &FD, SourceLocation Loc, SmallVectorImpl< Expr * > &PlacementArgs) |
|
static void | noteMemberDeclaredHere (Sema &S, Expr *E, FunctionScopeInfo &Fn) |
|
static Expr * | castForMoving (Sema &S, Expr *E, QualType T=QualType()) |
|
static VarDecl * | buildVarDecl (Sema &S, SourceLocation Loc, QualType Type, IdentifierInfo *II) |
| Build a variable declaration for move parameter. More...
|
|
Build calls to await_ready, await_suspend, and await_resume for a co_await expression.
The generated AST tries to clean up temporary objects as early as possible so that they don't live across suspension points if possible. Having temporary objects living across suspension points unnecessarily can lead to large frame size, and also lead to memory corruptions if the coroutine frame is destroyed after coming back from suspension. This is done by wrapping both the await_ready call and the await_suspend call with ExprWithCleanups. In the end of this function, we also need to explicitly set cleanup state so that the CoawaitExpr is also wrapped with an ExprWithCleanups to clean up the awaiter associated with the co_await expression.
Definition at line 373 of file SemaCoroutine.cpp.