Lines Matching refs:Loc
27 SourceLocation Loc) { in lookupPromiseType() argument
31 S.Diag(Loc, diag::err_implied_std_coroutine_traits_not_found); in lookupPromiseType()
36 Loc, Sema::LookupOrdinaryName); in lookupPromiseType()
38 S.Diag(Loc, diag::err_implied_std_coroutine_traits_not_found); in lookupPromiseType()
52 TemplateArgumentListInfo Args(Loc, Loc); in lookupPromiseType()
55 S.Context.getTrivialTypeSourceInfo(FnType->getReturnType(), Loc))); in lookupPromiseType()
60 TemplateArgument(T), S.Context.getTrivialTypeSourceInfo(T, Loc))); in lookupPromiseType()
64 S.CheckTemplateIdType(TemplateName(CoroTraits), Loc, Args); in lookupPromiseType()
67 if (S.RequireCompleteType(Loc, CoroTrait, in lookupPromiseType()
75 LookupResult R(S, &S.PP.getIdentifierTable().get("promise_type"), Loc, in lookupPromiseType()
80 S.Diag(Loc, diag::err_implied_std_coroutine_traits_promise_type_not_found) in lookupPromiseType()
94 S.Diag(Loc, diag::err_implied_std_coroutine_traits_promise_type_not_class) in lookupPromiseType()
104 checkCoroutineContext(Sema &S, SourceLocation Loc, StringRef Keyword) { in checkCoroutineContext() argument
107 S.Diag(Loc, diag::err_coroutine_unevaluated_context) << Keyword; in checkCoroutineContext()
115 S.Diag(Loc, isa<ObjCMethodDecl>(S.CurContext) in checkCoroutineContext()
124 S.Diag(Loc, diag::err_coroutine_ctor_dtor) in checkCoroutineContext()
127 S.Diag(Loc, diag::err_coroutine_constexpr) << Keyword; in checkCoroutineContext()
129 S.Diag(Loc, diag::err_coroutine_varargs) << Keyword; in checkCoroutineContext()
140 Loc); in checkCoroutineContext()
148 S.Context.getTrivialTypeSourceInfo(T, Loc), SC_None); in checkCoroutineContext()
163 SourceLocation Loc, Expr *E) { in buildOperatorCoawaitCall() argument
167 return SemaRef.CreateOverloadedUnaryOp(Loc, UO_Coawait, Functions, E); in buildOperatorCoawaitCall()
175 static ExprResult buildMemberCall(Sema &S, Expr *Base, SourceLocation Loc, in buildMemberCall() argument
178 DeclarationNameInfo NameInfo(&S.PP.getIdentifierTable().get(Name), Loc); in buildMemberCall()
183 Base, Base->getType(), Loc, /*IsPtr=*/false, SS, in buildMemberCall()
189 return S.ActOnCallExpr(nullptr, Result.get(), Loc, Args, Loc, nullptr); in buildMemberCall()
194 static ReadySuspendResumeResult buildCoawaitCalls(Sema &S, SourceLocation Loc, in buildCoawaitCalls() argument
202 Loc, E->getType(), VK_LValue, E->getObjectKind(), E); in buildCoawaitCalls()
205 ExprResult Result = buildMemberCall(S, Operand, Loc, Funcs[I], None); in buildCoawaitCalls()
215 ExprResult Sema::ActOnCoawaitExpr(Scope *S, SourceLocation Loc, Expr *E) { in ActOnCoawaitExpr() argument
222 ExprResult Awaitable = buildOperatorCoawaitCall(*this, S, Loc, E); in ActOnCoawaitExpr()
225 return BuildCoawaitExpr(Loc, Awaitable.get()); in ActOnCoawaitExpr()
227 ExprResult Sema::BuildCoawaitExpr(SourceLocation Loc, Expr *E) { in BuildCoawaitExpr() argument
228 auto *Coroutine = checkCoroutineContext(*this, Loc, "co_await"); in BuildCoawaitExpr()
239 Expr *Res = new (Context) CoawaitExpr(Loc, Context.DependentTy, E); in BuildCoawaitExpr()
250 ReadySuspendResumeResult RSS = buildCoawaitCalls(*this, Loc, E); in BuildCoawaitExpr()
254 Expr *Res = new (Context) CoawaitExpr(Loc, E, RSS.Results[0], RSS.Results[1], in BuildCoawaitExpr()
261 SourceLocation Loc, StringRef Name, in buildPromiseCall() argument
268 Promise, Promise->getType().getNonReferenceType(), VK_LValue, Loc); in buildPromiseCall()
273 return buildMemberCall(S, PromiseRef.get(), Loc, Name, Args); in buildPromiseCall()
276 ExprResult Sema::ActOnCoyieldExpr(Scope *S, SourceLocation Loc, Expr *E) { in ActOnCoyieldExpr() argument
277 auto *Coroutine = checkCoroutineContext(*this, Loc, "co_yield"); in ActOnCoyieldExpr()
283 buildPromiseCall(*this, Coroutine, Loc, "yield_value", E); in ActOnCoyieldExpr()
288 Awaitable = buildOperatorCoawaitCall(*this, S, Loc, Awaitable.get()); in ActOnCoyieldExpr()
292 return BuildCoyieldExpr(Loc, Awaitable.get()); in ActOnCoyieldExpr()
294 ExprResult Sema::BuildCoyieldExpr(SourceLocation Loc, Expr *E) { in BuildCoyieldExpr() argument
295 auto *Coroutine = checkCoroutineContext(*this, Loc, "co_yield"); in BuildCoyieldExpr()
306 Expr *Res = new (Context) CoyieldExpr(Loc, Context.DependentTy, E); in BuildCoyieldExpr()
317 ReadySuspendResumeResult RSS = buildCoawaitCalls(*this, Loc, E); in BuildCoyieldExpr()
321 Expr *Res = new (Context) CoyieldExpr(Loc, E, RSS.Results[0], RSS.Results[1], in BuildCoyieldExpr()
327 StmtResult Sema::ActOnCoreturnStmt(SourceLocation Loc, Expr *E) { in ActOnCoreturnStmt() argument
328 return BuildCoreturnStmt(Loc, E); in ActOnCoreturnStmt()
330 StmtResult Sema::BuildCoreturnStmt(SourceLocation Loc, Expr *E) { in BuildCoreturnStmt() argument
331 auto *Coroutine = checkCoroutineContext(*this, Loc, "co_return"); in BuildCoreturnStmt()
347 PC = buildPromiseCall(*this, Coroutine, Loc, "return_value", E); in BuildCoreturnStmt()
350 PC = buildPromiseCall(*this, Coroutine, Loc, "return_void", None); in BuildCoreturnStmt()
357 Stmt *Res = new (Context) CoreturnStmt(Loc, E, PCE); in BuildCoreturnStmt()
387 SourceLocation Loc = FD->getLocation(); in CheckCompletedCoroutineBody() local
392 ActOnDeclStmt(ConvertDeclToDeclGroup(Fn->CoroutinePromise), Loc, Loc); in CheckCompletedCoroutineBody()
398 buildPromiseCall(*this, Fn, Loc, "initial_suspend", None); in CheckCompletedCoroutineBody()
401 InitialSuspend = BuildCoawaitExpr(Loc, InitialSuspend.get()); in CheckCompletedCoroutineBody()
408 buildPromiseCall(*this, Fn, Loc, "final_suspend", None); in CheckCompletedCoroutineBody()
411 FinalSuspend = BuildCoawaitExpr(Loc, FinalSuspend.get()); in CheckCompletedCoroutineBody()
424 buildPromiseCall(*this, Fn, Loc, "get_return_object", None); in CheckCompletedCoroutineBody()
430 InitializedEntity::InitializeResult(Loc, RetType, false); in CheckCompletedCoroutineBody()
436 ReturnObject = ActOnFinishFullExpr(ReturnObject.get(), Loc); in CheckCompletedCoroutineBody()