@@ -5619,27 +5619,31 @@ DeclDeserializer::readAvailable_DECL_ATTR(SmallVectorImpl<uint64_t> &scratch,
5619
5619
DECODE_VER_TUPLE (Deprecated)
5620
5620
DECODE_VER_TUPLE (Obsoleted)
5621
5621
5622
- PlatformAgnosticAvailabilityKind platformAgnostic ;
5622
+ AvailableAttr::Kind kind ;
5623
5623
if (isUnavailable)
5624
- platformAgnostic = PlatformAgnosticAvailabilityKind ::Unavailable;
5624
+ kind = AvailableAttr::Kind ::Unavailable;
5625
5625
else if (isDeprecated)
5626
- platformAgnostic = PlatformAgnosticAvailabilityKind ::Deprecated;
5626
+ kind = AvailableAttr::Kind ::Deprecated;
5627
5627
else if (isNoAsync)
5628
- platformAgnostic = PlatformAgnosticAvailabilityKind::NoAsync;
5629
- else if (platform == PlatformKind::none &&
5630
- (!Introduced.empty () || !Deprecated.empty () || !Obsoleted.empty ()))
5631
- platformAgnostic =
5632
- isPackageDescriptionVersionSpecific
5633
- ? PlatformAgnosticAvailabilityKind::
5634
- PackageDescriptionVersionSpecific
5635
- : PlatformAgnosticAvailabilityKind::SwiftVersionSpecific;
5628
+ kind = AvailableAttr::Kind::NoAsync;
5636
5629
else
5637
- platformAgnostic = PlatformAgnosticAvailabilityKind::None;
5630
+ kind = AvailableAttr::Kind::Default;
5631
+
5632
+ AvailabilityDomain domain;
5633
+ if (platform != PlatformKind::none) {
5634
+ domain = AvailabilityDomain::forPlatform (platform);
5635
+ } else if (!Introduced.empty () || !Deprecated.empty () || !Obsoleted.empty ()) {
5636
+ domain = isPackageDescriptionVersionSpecific
5637
+ ? AvailabilityDomain::forPackageDescription ()
5638
+ : AvailabilityDomain::forSwiftLanguage ();
5639
+ } else {
5640
+ domain = AvailabilityDomain::forUniversal ();
5641
+ }
5638
5642
5639
- auto attr = new (ctx) AvailableAttr (
5640
- SourceLoc (), SourceRange (), platform, message, rename, Introduced ,
5641
- SourceRange (), Deprecated , SourceRange (), Obsoleted , SourceRange (),
5642
- platformAgnostic , isImplicit, isSPI, isForEmbedded);
5643
+ auto attr = new (ctx)
5644
+ AvailableAttr ( SourceLoc (), SourceRange (), domain, kind, message, rename ,
5645
+ Introduced , SourceRange (), Deprecated , SourceRange (),
5646
+ Obsoleted, SourceRange () , isImplicit, isSPI, isForEmbedded);
5643
5647
return attr;
5644
5648
}
5645
5649
0 commit comments