@@ -3892,11 +3892,37 @@ class PrintAttribute : public AttributeVisitor<PrintAttribute, void, StringRef>,
38923892 }
38933893 void visitAvailableAttr (AvailableAttr *Attr, StringRef label) {
38943894 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+ }
39003926 if (Attr->Introduced .has_value ())
39013927 printFieldRaw (
39023928 [&](auto &out) { out << Attr->Introduced .value ().getAsString (); },
@@ -3909,6 +3935,10 @@ class PrintAttribute : public AttributeVisitor<PrintAttribute, void, StringRef>,
39093935 printFieldRaw (
39103936 [&](auto &out) { out << Attr->Obsoleted .value ().getAsString (); },
39113937 " obsoleted" );
3938+ if (!Attr->Message .empty ())
3939+ printFieldQuoted (Attr->Message , " message" );
3940+ if (!Attr->Rename .empty ())
3941+ printFieldQuoted (Attr->Rename , " rename" );
39123942 printFoot ();
39133943 }
39143944 void visitBackDeployedAttr (BackDeployedAttr *Attr, StringRef label) {
0 commit comments