@@ -543,6 +543,25 @@ static void printShortFormAvailable(ArrayRef<const DeclAttribute *> Attrs,
543543 Printer.printNewline ();
544544}
545545
546+ static void printShortFormBackDeployed (ArrayRef<const DeclAttribute *> Attrs,
547+ ASTPrinter &Printer,
548+ const PrintOptions &Options) {
549+ assert (!Attrs.empty ());
550+ Printer << " @_backDeploy(before: " ;
551+ bool isFirst = true ;
552+
553+ for (auto *DA : Attrs) {
554+ if (!isFirst)
555+ Printer << " , " ;
556+ auto *attr = cast<BackDeployAttr>(DA);
557+ Printer << platformString (attr->Platform ) << " "
558+ << attr->Version .getAsString ();
559+ isFirst = false ;
560+ }
561+ Printer << " )" ;
562+ Printer.printNewline ();
563+ }
564+
546565// / The kind of a parameter in a `wrt:` differentiation parameters clause:
547566// / either a differentiability parameter or a linearity parameter. Used for
548567// / printing `@differentiable`, `@derivative`, and `@transpose` attributes.
@@ -754,6 +773,7 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options,
754773 AttributeVector shortAvailableAttributes;
755774 const DeclAttribute *swiftVersionAvailableAttribute = nullptr ;
756775 const DeclAttribute *packageDescriptionVersionAvailableAttribute = nullptr ;
776+ AttributeVector backDeployAttributes;
757777 AttributeVector longAttributes;
758778 AttributeVector attributes;
759779 AttributeVector modifiers;
@@ -791,6 +811,7 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options,
791811 }
792812
793813 AttributeVector &which = DA->isDeclModifier () ? modifiers :
814+ isa<BackDeployAttr>(DA) ? backDeployAttributes :
794815 isShortAvailable (DA) ? shortAvailableAttributes :
795816 DA->isLongAttribute () ? longAttributes :
796817 attributes;
@@ -803,6 +824,8 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options,
803824 printShortFormAvailable (packageDescriptionVersionAvailableAttribute, Printer, Options);
804825 if (!shortAvailableAttributes.empty ())
805826 printShortFormAvailable (shortAvailableAttributes, Printer, Options);
827+ if (!backDeployAttributes.empty ())
828+ printShortFormBackDeployed (backDeployAttributes, Printer, Options);
806829
807830 for (auto DA : longAttributes)
808831 DA->print (Printer, Options, D);
0 commit comments