@@ -3892,11 +3892,37 @@ class PrintAttribute : public AttributeVisitor<PrintAttribute, void, StringRef>,
3892
3892
}
3893
3893
void visitAvailableAttr (AvailableAttr *Attr, StringRef label) {
3894
3894
printCommon (Attr, " available_attr" , label);
3895
- printField (Attr->getPlatform (), " platform" );
3896
- if (!Attr->Message .empty ())
3897
- printFieldQuoted (Attr->Message , " message" );
3898
- if (!Attr->Rename .empty ())
3899
- printFieldQuoted (Attr->Rename , " rename" );
3895
+ switch (Attr->getPlatformAgnosticAvailability ()) {
3896
+ case PlatformAgnosticAvailabilityKind::None:
3897
+ case PlatformAgnosticAvailabilityKind::Deprecated:
3898
+ case PlatformAgnosticAvailabilityKind::Unavailable:
3899
+ case PlatformAgnosticAvailabilityKind::NoAsync:
3900
+ printField (Attr->getPlatform (), " platform" );
3901
+ break ;
3902
+ case PlatformAgnosticAvailabilityKind::UnavailableInSwift:
3903
+ case PlatformAgnosticAvailabilityKind::SwiftVersionSpecific:
3904
+ printFieldQuoted (" swift" , " platform" );
3905
+ break ;
3906
+ case PlatformAgnosticAvailabilityKind::PackageDescriptionVersionSpecific:
3907
+ printFieldQuoted (" _PackageDescription" , " platform" );
3908
+ break ;
3909
+ }
3910
+ switch (Attr->getPlatformAgnosticAvailability ()) {
3911
+ case PlatformAgnosticAvailabilityKind::Deprecated:
3912
+ printFlag (" deprecated" );
3913
+ break ;
3914
+ case PlatformAgnosticAvailabilityKind::Unavailable:
3915
+ case PlatformAgnosticAvailabilityKind::UnavailableInSwift:
3916
+ printFlag (" unavailable" );
3917
+ break ;
3918
+ case PlatformAgnosticAvailabilityKind::NoAsync:
3919
+ printFlag (" noasync" );
3920
+ break ;
3921
+ case PlatformAgnosticAvailabilityKind::None:
3922
+ case PlatformAgnosticAvailabilityKind::SwiftVersionSpecific:
3923
+ case PlatformAgnosticAvailabilityKind::PackageDescriptionVersionSpecific:
3924
+ break ;
3925
+ }
3900
3926
if (Attr->Introduced .has_value ())
3901
3927
printFieldRaw (
3902
3928
[&](auto &out) { out << Attr->Introduced .value ().getAsString (); },
@@ -3909,6 +3935,10 @@ class PrintAttribute : public AttributeVisitor<PrintAttribute, void, StringRef>,
3909
3935
printFieldRaw (
3910
3936
[&](auto &out) { out << Attr->Obsoleted .value ().getAsString (); },
3911
3937
" obsoleted" );
3938
+ if (!Attr->Message .empty ())
3939
+ printFieldQuoted (Attr->Message , " message" );
3940
+ if (!Attr->Rename .empty ())
3941
+ printFieldQuoted (Attr->Rename , " rename" );
3912
3942
printFoot ();
3913
3943
}
3914
3944
void visitBackDeployedAttr (BackDeployedAttr *Attr, StringRef label) {
0 commit comments