@@ -445,9 +445,10 @@ ResilienceExpansion DeclContext::getResilienceExpansion() const {
445445
446446FragileFunctionKind DeclContext::getFragileFunctionKind () const {
447447 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});
451452}
452453
453454FragileFunctionKind
@@ -466,23 +467,17 @@ swift::FragileFunctionKindRequest::evaluate(Evaluator &evaluator,
466467 if (VD->getDeclContext ()->isLocalContext ()) {
467468 auto kind = VD->getDeclContext ()->getFragileFunctionKind ();
468469 if (kind.kind != FragileFunctionKind::None)
469- return {FragileFunctionKind::DefaultArgument,
470- kind.allowUsableFromInline };
470+ return {FragileFunctionKind::DefaultArgument};
471471 }
472472
473473 auto effectiveAccess =
474- VD->getFormalAccessScope (/* useDC=*/ nullptr ,
475- /* treatUsableFromInlineAsPublic=*/ true );
476- auto formalAccess =
477- VD->getFormalAccessScope (/* useDC=*/ nullptr ,
478- /* treatUsableFromInlineAsPublic=*/ false );
474+ VD->getFormalAccessScope (/* useDC=*/ nullptr ,
475+ /* treatUsableFromInlineAsPublic=*/ true );
479476 if (effectiveAccess.isPublic ()) {
480- return {FragileFunctionKind::DefaultArgument,
481- !formalAccess.isPublic ()};
477+ return {FragileFunctionKind::DefaultArgument};
482478 }
483479
484- return {FragileFunctionKind::None,
485- /* allowUsableFromInline=*/ false };
480+ return {FragileFunctionKind::None};
486481 }
487482
488483 // Stored property initializer contexts use minimal resilience expansion
@@ -491,13 +486,11 @@ swift::FragileFunctionKindRequest::evaluate(Evaluator &evaluator,
491486 auto bindingIndex = init->getBindingIndex ();
492487 if (auto *varDecl = init->getBinding ()->getAnchoringVarDecl (bindingIndex)) {
493488 if (varDecl->isInitExposedToClients ()) {
494- return {FragileFunctionKind::PropertyInitializer,
495- /* allowUsableFromInline=*/ true };
489+ return {FragileFunctionKind::PropertyInitializer};
496490 }
497491 }
498492
499- return {FragileFunctionKind::None,
500- /* allowUsableFromInline=*/ false };
493+ return {FragileFunctionKind::None};
501494 }
502495
503496 if (auto *AFD = dyn_cast<AbstractFunctionDecl>(dc)) {
@@ -513,53 +506,44 @@ swift::FragileFunctionKindRequest::evaluate(Evaluator &evaluator,
513506 // If the function is not externally visible, we will not be serializing
514507 // its body.
515508 if (!funcAccess.isPublic ()) {
516- return {FragileFunctionKind::None,
517- /* allowUsableFromInline=*/ false };
509+ return {FragileFunctionKind::None};
518510 }
519511
520512 // If the function is public, @_transparent implies @inlinable.
521513 if (AFD->isTransparent ()) {
522- return {FragileFunctionKind::Transparent,
523- /* allowUsableFromInline=*/ true };
514+ return {FragileFunctionKind::Transparent};
524515 }
525516
526517 if (AFD->getAttrs ().hasAttribute <InlinableAttr>()) {
527- return {FragileFunctionKind::Inlinable,
528- /* allowUsableFromInline=*/ true };
518+ return {FragileFunctionKind::Inlinable};
529519 }
530520
531521 if (AFD->getAttrs ().hasAttribute <AlwaysEmitIntoClientAttr>()) {
532- return {FragileFunctionKind::AlwaysEmitIntoClient,
533- /* allowUsableFromInline=*/ true };
522+ return {FragileFunctionKind::AlwaysEmitIntoClient};
534523 }
535524
536525 if (AFD->isBackDeployed (context->getASTContext ())) {
537- return {FragileFunctionKind::BackDeploy,
538- /* allowUsableFromInline=*/ true };
526+ return {FragileFunctionKind::BackDeploy};
539527 }
540528
541529 // Property and subscript accessors inherit @_alwaysEmitIntoClient,
542530 // @backDeployed, and @inlinable from their storage declarations.
543531 if (auto accessor = dyn_cast<AccessorDecl>(AFD)) {
544532 auto *storage = accessor->getStorage ();
545533 if (storage->getAttrs ().getAttribute <InlinableAttr>()) {
546- return {FragileFunctionKind::Inlinable,
547- /* allowUsableFromInline=*/ true };
534+ return {FragileFunctionKind::Inlinable};
548535 }
549536 if (storage->getAttrs ().hasAttribute <AlwaysEmitIntoClientAttr>()) {
550- return {FragileFunctionKind::AlwaysEmitIntoClient,
551- /* allowUsableFromInline=*/ true };
537+ return {FragileFunctionKind::AlwaysEmitIntoClient};
552538 }
553539 if (storage->isBackDeployed (context->getASTContext ())) {
554- return {FragileFunctionKind::BackDeploy,
555- /* allowUsableFromInline=*/ true };
540+ return {FragileFunctionKind::BackDeploy};
556541 }
557542 }
558543 }
559544 }
560545
561- return {FragileFunctionKind::None,
562- /* allowUsableFromInline=*/ false };
546+ return {FragileFunctionKind::None};
563547}
564548
565549// / Determine whether the innermost context is generic.
0 commit comments