@@ -541,6 +541,25 @@ static void printShortFormAvailable(ArrayRef<const DeclAttribute *> Attrs,
541
541
Printer.printNewline ();
542
542
}
543
543
544
+ static void printShortFormBackDeployed (ArrayRef<const DeclAttribute *> Attrs,
545
+ ASTPrinter &Printer,
546
+ const PrintOptions &Options) {
547
+ assert (!Attrs.empty ());
548
+ Printer << " @_backDeploy(before: " ;
549
+ bool isFirst = true ;
550
+
551
+ for (auto *DA : Attrs) {
552
+ if (!isFirst)
553
+ Printer << " , " ;
554
+ auto *attr = cast<BackDeployAttr>(DA);
555
+ Printer << platformString (attr->Platform ) << " "
556
+ << attr->Version .getAsString ();
557
+ isFirst = false ;
558
+ }
559
+ Printer << " )" ;
560
+ Printer.printNewline ();
561
+ }
562
+
544
563
// / The kind of a parameter in a `wrt:` differentiation parameters clause:
545
564
// / either a differentiability parameter or a linearity parameter. Used for
546
565
// / printing `@differentiable`, `@derivative`, and `@transpose` attributes.
@@ -752,6 +771,7 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options,
752
771
AttributeVector shortAvailableAttributes;
753
772
const DeclAttribute *swiftVersionAvailableAttribute = nullptr ;
754
773
const DeclAttribute *packageDescriptionVersionAvailableAttribute = nullptr ;
774
+ AttributeVector backDeployAttributes;
755
775
AttributeVector longAttributes;
756
776
AttributeVector attributes;
757
777
AttributeVector modifiers;
@@ -789,6 +809,7 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options,
789
809
}
790
810
791
811
AttributeVector &which = DA->isDeclModifier () ? modifiers :
812
+ isa<BackDeployAttr>(DA) ? backDeployAttributes :
792
813
isShortAvailable (DA) ? shortAvailableAttributes :
793
814
DA->isLongAttribute () ? longAttributes :
794
815
attributes;
@@ -801,6 +822,8 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options,
801
822
printShortFormAvailable (packageDescriptionVersionAvailableAttribute, Printer, Options);
802
823
if (!shortAvailableAttributes.empty ())
803
824
printShortFormAvailable (shortAvailableAttributes, Printer, Options);
825
+ if (!backDeployAttributes.empty ())
826
+ printShortFormBackDeployed (backDeployAttributes, Printer, Options);
804
827
805
828
for (auto DA : longAttributes)
806
829
DA->print (Printer, Options, D);
0 commit comments