@@ -597,13 +597,13 @@ Decl::getIntroducedOSVersion(PlatformKind Kind) const {
597597}
598598
599599std::optional<std::pair<const BackDeployedAttr *, AvailabilityRange>>
600- Decl::getBackDeployedAttrAndRange (ASTContext &Ctx,
601- bool forTargetVariant) const {
602- if (auto *attr = getAttrs ().getBackDeployed (Ctx , forTargetVariant)) {
600+ Decl::getBackDeployedAttrAndRange (bool forTargetVariant) const {
601+ auto &ctx = getASTContext ();
602+ if (auto *attr = getAttrs ().getBackDeployed (ctx , forTargetVariant)) {
603603 auto version = attr->getVersion ();
604604 AvailabilityDomain ignoredDomain;
605605 AvailabilityInference::updateBeforeAvailabilityDomainForFallback (
606- attr, getASTContext () , ignoredDomain, version);
606+ attr, ctx , ignoredDomain, version);
607607
608608 // If the remap for fallback resulted in 1.0, then the
609609 // backdeployment prior to that is not meaningful.
@@ -615,14 +615,12 @@ Decl::getBackDeployedAttrAndRange(ASTContext &Ctx,
615615
616616 // Accessors may inherit `@backDeployed`.
617617 if (auto *AD = dyn_cast<AccessorDecl>(this ))
618- return AD->getStorage ()->getBackDeployedAttrAndRange (Ctx, forTargetVariant);
618+ return AD->getStorage ()->getBackDeployedAttrAndRange (forTargetVariant);
619619
620620 return std::nullopt ;
621621}
622622
623623bool Decl::isBackDeployed () const {
624- auto &Ctx = getASTContext ();
625-
626624 // A function declared in a local context can never be back-deployed.
627625 if (getDeclContext ()->isLocalContext ())
628626 return false ;
@@ -636,11 +634,11 @@ bool Decl::isBackDeployed() const {
636634 return false ;
637635 }
638636
639- if (getBackDeployedAttrAndRange (Ctx ))
637+ if (getBackDeployedAttrAndRange ())
640638 return true ;
641639
642- if (Ctx .LangOpts .TargetVariant ) {
643- if (getBackDeployedAttrAndRange (Ctx, /* forTargetVariant=*/ true ))
640+ if (getASTContext () .LangOpts .TargetVariant ) {
641+ if (getBackDeployedAttrAndRange (/* forTargetVariant=*/ true ))
644642 return true ;
645643 }
646644
@@ -1482,7 +1480,7 @@ AvailabilityRange Decl::getAvailabilityForLinkage() const {
14821480
14831481 // When computing availability for linkage, use the "before" version from
14841482 // the @backDeployed attribute, if present.
1485- if (auto backDeployedAttrAndRange = getBackDeployedAttrAndRange (ctx ))
1483+ if (auto backDeployedAttrAndRange = getBackDeployedAttrAndRange ())
14861484 return backDeployedAttrAndRange->second ;
14871485
14881486 auto containingContext = AvailabilityInference::annotatedAvailableRange (this );
0 commit comments