@@ -400,23 +400,24 @@ const AvailableAttr *DeclAttributes::getNoAsync(const ASTContext &ctx) const {
400400 return bestAttr;
401401}
402402
403- const BackDeployAttr *
404- DeclAttributes::getBackDeploy (const ASTContext &ctx) const {
405- const BackDeployAttr *bestAttr = nullptr ;
403+ const BackDeployedAttr *
404+ DeclAttributes::getBackDeployed (const ASTContext &ctx) const {
405+ const BackDeployedAttr *bestAttr = nullptr ;
406406
407407 for (auto attr : *this ) {
408- auto *backDeployAttr = dyn_cast<BackDeployAttr >(attr);
409- if (!backDeployAttr )
408+ auto *backDeployedAttr = dyn_cast<BackDeployedAttr >(attr);
409+ if (!backDeployedAttr )
410410 continue ;
411411
412- if (backDeployAttr->isInvalid () || !backDeployAttr->isActivePlatform (ctx))
412+ if (backDeployedAttr->isInvalid () ||
413+ !backDeployedAttr->isActivePlatform (ctx))
413414 continue ;
414415
415416 // We have an attribute that is active for the platform, but
416417 // is it more specific than our current best?
417- if (!bestAttr || inheritsAvailabilityFromPlatform (backDeployAttr-> Platform ,
418- bestAttr->Platform )) {
419- bestAttr = backDeployAttr ;
418+ if (!bestAttr || inheritsAvailabilityFromPlatform (
419+ backDeployedAttr-> Platform , bestAttr->Platform )) {
420+ bestAttr = backDeployedAttr ;
420421 }
421422 }
422423
@@ -547,13 +548,14 @@ static void printShortFormBackDeployed(ArrayRef<const DeclAttribute *> Attrs,
547548 ASTPrinter &Printer,
548549 const PrintOptions &Options) {
549550 assert (!Attrs.empty ());
551+ // TODO: Print `@backDeployed` in swiftinterfaces (rdar://104920183)
550552 Printer << " @_backDeploy(before: " ;
551553 bool isFirst = true ;
552554
553555 for (auto *DA : Attrs) {
554556 if (!isFirst)
555557 Printer << " , " ;
556- auto *attr = cast<BackDeployAttr >(DA);
558+ auto *attr = cast<BackDeployedAttr >(DA);
557559 Printer << platformString (attr->Platform ) << " "
558560 << attr->Version .getAsString ();
559561 isFirst = false ;
@@ -773,7 +775,7 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options,
773775 AttributeVector shortAvailableAttributes;
774776 const DeclAttribute *swiftVersionAvailableAttribute = nullptr ;
775777 const DeclAttribute *packageDescriptionVersionAvailableAttribute = nullptr ;
776- AttributeVector backDeployAttributes ;
778+ AttributeVector backDeployedAttributes ;
777779 AttributeVector longAttributes;
778780 AttributeVector attributes;
779781 AttributeVector modifiers;
@@ -811,7 +813,7 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options,
811813 }
812814
813815 AttributeVector &which = DA->isDeclModifier () ? modifiers :
814- isa<BackDeployAttr >(DA) ? backDeployAttributes :
816+ isa<BackDeployedAttr >(DA) ? backDeployedAttributes :
815817 isShortAvailable (DA) ? shortAvailableAttributes :
816818 DA->isLongAttribute () ? longAttributes :
817819 attributes;
@@ -824,8 +826,8 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options,
824826 printShortFormAvailable (packageDescriptionVersionAvailableAttribute, Printer, Options);
825827 if (!shortAvailableAttributes.empty ())
826828 printShortFormAvailable (shortAvailableAttributes, Printer, Options);
827- if (!backDeployAttributes .empty ())
828- printShortFormBackDeployed (backDeployAttributes , Printer, Options);
829+ if (!backDeployedAttributes .empty ())
830+ printShortFormBackDeployed (backDeployedAttributes , Printer, Options);
829831
830832 for (auto DA : longAttributes)
831833 DA->print (Printer, Options, D);
@@ -1324,10 +1326,11 @@ bool DeclAttribute::printImpl(ASTPrinter &Printer, const PrintOptions &Options,
13241326 break ;
13251327 }
13261328
1327- case DAK_BackDeploy: {
1329+ case DAK_BackDeployed: {
1330+ // TODO: Print `@backDeployed` in swiftinterfaces (rdar://104920183)
13281331 Printer.printAttrName (" @_backDeploy" );
13291332 Printer << " (before: " ;
1330- auto Attr = cast<BackDeployAttr >(this );
1333+ auto Attr = cast<BackDeployedAttr >(this );
13311334 Printer << platformString (Attr->Platform ) << " " <<
13321335 Attr->Version .getAsString ();
13331336 Printer << " )" ;
@@ -1534,8 +1537,8 @@ StringRef DeclAttribute::getAttrName() const {
15341537 return " transpose" ;
15351538 case DAK_UnavailableFromAsync:
15361539 return " _unavailableFromAsync" ;
1537- case DAK_BackDeploy :
1538- return " _backDeploy " ;
1540+ case DAK_BackDeployed :
1541+ return " backDeployed " ;
15391542 case DAK_Expose:
15401543 return " _expose" ;
15411544 case DAK_Documentation:
@@ -1791,7 +1794,7 @@ bool AvailableAttr::isActivePlatform(const ASTContext &ctx) const {
17911794 return isPlatformActive (Platform, ctx.LangOpts );
17921795}
17931796
1794- bool BackDeployAttr ::isActivePlatform (const ASTContext &ctx) const {
1797+ bool BackDeployedAttr ::isActivePlatform (const ASTContext &ctx) const {
17951798 return isPlatformActive (Platform, ctx.LangOpts );
17961799}
17971800
0 commit comments