Skip to content

Commit ce324c5

Browse files
committed
Remove unnecessary changes from SemaCoroutine
1 parent 5ad3373 commit ce324c5

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
@@ -267,7 +267,7 @@ static ExprResult buildOperatorCoawaitCall(Sema &SemaRef, Scope *S,
267267
}
268268

269269
static ExprResult buildCoroutineHandle(Sema &S, QualType PromiseType,
270-
Expr *FramePtr, SourceLocation Loc) {
270+
SourceLocation Loc) {
271271
QualType CoroHandleType = lookupCoroutineHandleType(S, PromiseType, Loc);
272272
if (CoroHandleType.isNull())
273273
return ExprError();
@@ -281,6 +281,9 @@ static ExprResult buildCoroutineHandle(Sema &S, QualType PromiseType,
281281
return ExprError();
282282
}
283283

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

@@ -401,10 +403,7 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise,
401403

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

409408
using ACT = ReadySuspendResumeResult::AwaitCallType;
410409

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

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

0 commit comments

Comments
 (0)