@@ -445,9 +445,10 @@ ResilienceExpansion DeclContext::getResilienceExpansion() const {
445
445
446
446
FragileFunctionKind DeclContext::getFragileFunctionKind () const {
447
447
auto &context = getASTContext ();
448
- return evaluateOrDefault (context.evaluator ,
449
- FragileFunctionKindRequest { const_cast <DeclContext *>(this ) },
450
- {FragileFunctionKind::None, false });
448
+ return evaluateOrDefault (
449
+ context.evaluator ,
450
+ FragileFunctionKindRequest{const_cast <DeclContext *>(this )},
451
+ {FragileFunctionKind::None});
451
452
}
452
453
453
454
FragileFunctionKind
@@ -466,20 +467,17 @@ swift::FragileFunctionKindRequest::evaluate(Evaluator &evaluator,
466
467
if (VD->getDeclContext ()->isLocalContext ()) {
467
468
auto kind = VD->getDeclContext ()->getFragileFunctionKind ();
468
469
if (kind.kind != FragileFunctionKind::None)
469
- return {FragileFunctionKind::DefaultArgument,
470
- kind.allowUsableFromInline };
470
+ return {FragileFunctionKind::DefaultArgument};
471
471
}
472
472
473
473
auto effectiveAccess =
474
474
VD->getFormalAccessScope (/* useDC=*/ nullptr ,
475
475
/* treatUsableFromInlineAsPublic=*/ true );
476
476
if (effectiveAccess.isPublic ()) {
477
- return {FragileFunctionKind::DefaultArgument,
478
- /* allowUsableFromInline=*/ true };
477
+ return {FragileFunctionKind::DefaultArgument};
479
478
}
480
479
481
- return {FragileFunctionKind::None,
482
- /* allowUsableFromInline=*/ false };
480
+ return {FragileFunctionKind::None};
483
481
}
484
482
485
483
// Stored property initializer contexts use minimal resilience expansion
@@ -488,13 +486,11 @@ swift::FragileFunctionKindRequest::evaluate(Evaluator &evaluator,
488
486
auto bindingIndex = init->getBindingIndex ();
489
487
if (auto *varDecl = init->getBinding ()->getAnchoringVarDecl (bindingIndex)) {
490
488
if (varDecl->isInitExposedToClients ()) {
491
- return {FragileFunctionKind::PropertyInitializer,
492
- /* allowUsableFromInline=*/ true };
489
+ return {FragileFunctionKind::PropertyInitializer};
493
490
}
494
491
}
495
492
496
- return {FragileFunctionKind::None,
497
- /* allowUsableFromInline=*/ false };
493
+ return {FragileFunctionKind::None};
498
494
}
499
495
500
496
if (auto *AFD = dyn_cast<AbstractFunctionDecl>(dc)) {
@@ -510,53 +506,44 @@ swift::FragileFunctionKindRequest::evaluate(Evaluator &evaluator,
510
506
// If the function is not externally visible, we will not be serializing
511
507
// its body.
512
508
if (!funcAccess.isPublic ()) {
513
- return {FragileFunctionKind::None,
514
- /* allowUsableFromInline=*/ false };
509
+ return {FragileFunctionKind::None};
515
510
}
516
511
517
512
// If the function is public, @_transparent implies @inlinable.
518
513
if (AFD->isTransparent ()) {
519
- return {FragileFunctionKind::Transparent,
520
- /* allowUsableFromInline=*/ true };
514
+ return {FragileFunctionKind::Transparent};
521
515
}
522
516
523
517
if (AFD->getAttrs ().hasAttribute <InlinableAttr>()) {
524
- return {FragileFunctionKind::Inlinable,
525
- /* allowUsableFromInline=*/ true };
518
+ return {FragileFunctionKind::Inlinable};
526
519
}
527
520
528
521
if (AFD->getAttrs ().hasAttribute <AlwaysEmitIntoClientAttr>()) {
529
- return {FragileFunctionKind::AlwaysEmitIntoClient,
530
- /* allowUsableFromInline=*/ true };
522
+ return {FragileFunctionKind::AlwaysEmitIntoClient};
531
523
}
532
524
533
525
if (AFD->isBackDeployed (context->getASTContext ())) {
534
- return {FragileFunctionKind::BackDeploy,
535
- /* allowUsableFromInline=*/ true };
526
+ return {FragileFunctionKind::BackDeploy};
536
527
}
537
528
538
529
// Property and subscript accessors inherit @_alwaysEmitIntoClient,
539
530
// @backDeployed, and @inlinable from their storage declarations.
540
531
if (auto accessor = dyn_cast<AccessorDecl>(AFD)) {
541
532
auto *storage = accessor->getStorage ();
542
533
if (storage->getAttrs ().getAttribute <InlinableAttr>()) {
543
- return {FragileFunctionKind::Inlinable,
544
- /* allowUsableFromInline=*/ true };
534
+ return {FragileFunctionKind::Inlinable};
545
535
}
546
536
if (storage->getAttrs ().hasAttribute <AlwaysEmitIntoClientAttr>()) {
547
- return {FragileFunctionKind::AlwaysEmitIntoClient,
548
- /* allowUsableFromInline=*/ true };
537
+ return {FragileFunctionKind::AlwaysEmitIntoClient};
549
538
}
550
539
if (storage->isBackDeployed (context->getASTContext ())) {
551
- return {FragileFunctionKind::BackDeploy,
552
- /* allowUsableFromInline=*/ true };
540
+ return {FragileFunctionKind::BackDeploy};
553
541
}
554
542
}
555
543
}
556
544
}
557
545
558
- return {FragileFunctionKind::None,
559
- /* allowUsableFromInline=*/ false };
546
+ return {FragileFunctionKind::None};
560
547
}
561
548
562
549
// / Determine whether the innermost context is generic.
0 commit comments