Skip to content

Commit 1b6e5a5

Browse files
committed
Remove unnecessary changes from SemaCoroutine
1 parent 20a7dfb commit 1b6e5a5

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

clang/lib/Sema/SemaCoroutine.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static ExprResult buildOperatorCoawaitCall(Sema &SemaRef, Scope *S,
266266
}
267267

268268
static ExprResult buildCoroutineHandle(Sema &S, QualType PromiseType,
269-
Expr *FramePtr, SourceLocation Loc) {
269+
SourceLocation Loc) {
270270
QualType CoroHandleType = lookupCoroutineHandleType(S, PromiseType, Loc);
271271
if (CoroHandleType.isNull())
272272
return ExprError();
@@ -280,6 +280,9 @@ static ExprResult buildCoroutineHandle(Sema &S, QualType PromiseType,
280280
return ExprError();
281281
}
282282

283+
Expr *FramePtr =
284+
S.BuildBuiltinCallExpr(Loc, Builtin::BI__builtin_coro_frame, {});
285+
283286
CXXScopeSpec SS;
284287
ExprResult FromAddr =
285288
S.BuildDeclarationNameExpr(SS, Found, /*NeedsADL=*/false);
@@ -293,7 +296,6 @@ struct ReadySuspendResumeResult {
293296
enum AwaitCallType { ACT_Ready, ACT_Suspend, ACT_Resume };
294297
Expr *Results[3];
295298
OpaqueValueExpr *OpaqueValue;
296-
bool IsSuspendNoThrow;
297299
bool IsInvalid;
298300
};
299301

@@ -400,10 +402,7 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise,
400402

401403
// Assume valid until we see otherwise.
402404
// Further operations are responsible for setting IsInalid to true.
403-
ReadySuspendResumeResult Calls = {{},
404-
Operand,
405-
/*IsSuspendNoThrow=*/false,
406-
/*IsInvalid=*/false};
405+
ReadySuspendResumeResult Calls = {{}, Operand, /*IsInvalid=*/false};
407406

408407
using ACT = ReadySuspendResumeResult::AwaitCallType;
409408

@@ -437,11 +436,8 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise,
437436
Calls.Results[ACT::ACT_Ready] = S.MaybeCreateExprWithCleanups(Conv.get());
438437
}
439438

440-
Expr *FramePtr =
441-
S.BuildBuiltinCallExpr(Loc, Builtin::BI__builtin_coro_frame, {});
442-
443439
ExprResult CoroHandleRes =
444-
buildCoroutineHandle(S, CoroPromise->getType(), FramePtr, Loc);
440+
buildCoroutineHandle(S, CoroPromise->getType(), Loc);
445441
if (CoroHandleRes.isInvalid()) {
446442
Calls.IsInvalid = true;
447443
return Calls;

0 commit comments

Comments
 (0)