clang
3.9.0
|
#include "clang/Sema/SemaInternal.h"
#include "clang/AST/Decl.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/StmtCXX.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Overload.h"
Go to the source code of this file.
Classes | |
struct | ReadySuspendResumeResult |
Functions | |
static QualType | lookupPromiseType (Sema &S, const FunctionProtoType *FnType, SourceLocation Loc) |
Look up the std::coroutine_traits<...>::promise_type for the given function type. More... | |
static FunctionScopeInfo * | checkCoroutineContext (Sema &S, SourceLocation Loc, StringRef Keyword) |
Check that this is a context in which a coroutine suspension can appear. More... | |
static ExprResult | buildOperatorCoawaitCall (Sema &SemaRef, Scope *S, SourceLocation Loc, Expr *E) |
Build a call to 'operator co_await' if there is a suitable operator for the given expression. More... | |
static ExprResult | buildMemberCall (Sema &S, Expr *Base, SourceLocation Loc, StringRef Name, MutableArrayRef< Expr * > Args) |
static ReadySuspendResumeResult | buildCoawaitCalls (Sema &S, 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, FunctionScopeInfo *Coroutine, SourceLocation Loc, StringRef Name, MutableArrayRef< Expr * > Args) |
|
static |
Build calls to await_ready, await_suspend, and await_resume for a co_await expression.
Definition at line 194 of file SemaCoroutine.cpp.
References buildMemberCall(), clang::Sema::Context, E, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Expr::getObjectKind(), clang::Expr::getType(), I, clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), ReadySuspendResumeResult::IsInvalid, clang::None, clang::Result, ReadySuspendResumeResult::Results, and clang::VK_LValue.
Referenced by clang::Sema::BuildCoawaitExpr(), and clang::Sema::BuildCoyieldExpr().
|
static |
Definition at line 175 of file SemaCoroutine.cpp.
References clang::Sema::ActOnCallExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::ExprError(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::IdentifierTable::get(), clang::Preprocessor::getIdentifierTable(), clang::Expr::getType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Sema::PP, and clang::Result.
Referenced by buildCoawaitCalls(), and buildPromiseCall().
|
static |
Build a call to 'operator co_await' if there is a suitable operator for the given expression.
Definition at line 162 of file SemaCoroutine.cpp.
References clang::Sema::CreateOverloadedUnaryOp(), clang::Expr::getType(), and clang::Sema::LookupOverloadedOperatorName().
Referenced by clang::Sema::ActOnCoawaitExpr(), and clang::Sema::ActOnCoyieldExpr().
|
static |
Definition at line 260 of file SemaCoroutine.cpp.
References clang::Sema::BuildDeclRefExpr(), buildMemberCall(), clang::sema::FunctionScopeInfo::CoroutinePromise, clang::ExprError(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Name, and clang::VK_LValue.
Referenced by clang::Sema::ActOnCoyieldExpr(), clang::Sema::BuildCoreturnStmt(), and clang::Sema::CheckCompletedCoroutineBody().
|
static |
Check that this is a context in which a coroutine suspension can appear.
Definition at line 104 of file SemaCoroutine.cpp.
References clang::Sema::ActOnUninitializedDecl(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::Context, clang::VarDecl::Create(), clang::Sema::CurContext, clang::ASTContext::DependentTy, clang::Sema::Diag(), clang::IdentifierTable::get(), clang::Sema::getCurFunction(), clang::Preprocessor::getIdentifierTable(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::Type::isDependentType(), clang::QualType::isNull(), clang::Sema::isUnevaluatedContext(), lookupPromiseType(), clang::Sema::PP, and clang::SC_None.
Referenced by clang::Sema::ActOnCoyieldExpr(), clang::Sema::BuildCoawaitExpr(), clang::Sema::BuildCoreturnStmt(), and clang::Sema::BuildCoyieldExpr().
|
static |
Look up the std::coroutine_traits<...>::promise_type for the given function type.
Definition at line 26 of file SemaCoroutine.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::Sema::CheckTemplateIdType(), clang::Sema::Context, clang::NestedNameSpecifier::Create(), clang::Sema::Diag(), clang::ETK_None, clang::IdentifierTable::get(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getElaboratedType(), clang::Preprocessor::getIdentifierTable(), clang::FunctionProtoType::getParamTypes(), clang::FunctionType::getReturnType(), clang::Sema::getStdNamespace(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ASTContext::getTypeDeclType(), clang::QualType::getTypePtr(), clang::QualType::isNull(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), clang::Sema::PP, clang::Sema::RequireCompleteType(), and clang::Result.
Referenced by checkCoroutineContext().