@@ -2234,15 +2234,16 @@ AvailableAttr::AvailableAttr(
22342234 Message(Message), Rename(Rename), RenameDecl(RenameDecl),
22352235 INIT_VER_TUPLE(Introduced), IntroducedRange(IntroducedRange),
22362236 INIT_VER_TUPLE(Deprecated), DeprecatedRange(DeprecatedRange),
2237- INIT_VER_TUPLE(Obsoleted), ObsoletedRange(ObsoletedRange),
2238- PlatformAgnostic(PlatformAgnostic), Platform(Platform) {
2237+ INIT_VER_TUPLE(Obsoleted), ObsoletedRange(ObsoletedRange) {
2238+ Bits.AvailableAttr .Platform = static_cast <uint8_t >(Platform);
2239+ Bits.AvailableAttr .PlatformAgnostic = static_cast <uint8_t >(PlatformAgnostic);
22392240 Bits.AvailableAttr .IsSPI = IsSPI;
22402241
22412242 if (IsForEmbedded) {
22422243 // FIXME: The IsForEmbedded bit should be removed when library availability
22432244 // conditions are implemented (rdar://138802876)
22442245 Bits.AvailableAttr .IsForEmbedded = true ;
2245- assert (Platform == PlatformKind::none);
2246+ assert (getPlatform () == PlatformKind::none);
22462247 }
22472248}
22482249
@@ -2279,7 +2280,7 @@ AvailableAttr *AvailableAttr::createForAlternative(
22792280}
22802281
22812282bool AvailableAttr::isActivePlatform (const ASTContext &ctx) const {
2282- return isPlatformActive (Platform , ctx.LangOpts );
2283+ return isPlatformActive (getPlatform () , ctx.LangOpts );
22832284}
22842285
22852286bool BackDeployedAttr::isActivePlatform (const ASTContext &ctx,
@@ -2290,14 +2291,14 @@ bool BackDeployedAttr::isActivePlatform(const ASTContext &ctx,
22902291AvailableAttr *AvailableAttr::clone (ASTContext &C, bool implicit) const {
22912292 return new (C) AvailableAttr (implicit ? SourceLoc () : AtLoc,
22922293 implicit ? SourceRange () : getRange (),
2293- Platform , Message, Rename, RenameDecl,
2294+ getPlatform () , Message, Rename, RenameDecl,
22942295 Introduced ? *Introduced : llvm::VersionTuple (),
22952296 implicit ? SourceRange () : IntroducedRange,
22962297 Deprecated ? *Deprecated : llvm::VersionTuple (),
22972298 implicit ? SourceRange () : DeprecatedRange,
22982299 Obsoleted ? *Obsoleted : llvm::VersionTuple (),
22992300 implicit ? SourceRange () : ObsoletedRange,
2300- PlatformAgnostic ,
2301+ getPlatformAgnosticAvailability () ,
23012302 implicit,
23022303 isSPI (),
23032304 isForEmbedded ());
@@ -2332,10 +2333,10 @@ OriginallyDefinedInAttr *OriginallyDefinedInAttr::clone(ASTContext &C,
23322333}
23332334
23342335bool AvailableAttr::isLanguageVersionSpecific () const {
2335- if (PlatformAgnostic ==
2336+ if (getPlatformAgnosticAvailability () ==
23362337 PlatformAgnosticAvailabilityKind::SwiftVersionSpecific)
23372338 {
2338- assert (Platform == PlatformKind::none &&
2339+ assert (getPlatform () == PlatformKind::none &&
23392340 (Introduced.has_value () ||
23402341 Deprecated.has_value () ||
23412342 Obsoleted.has_value ()));
@@ -2345,10 +2346,10 @@ bool AvailableAttr::isLanguageVersionSpecific() const {
23452346}
23462347
23472348bool AvailableAttr::isPackageDescriptionVersionSpecific () const {
2348- if (PlatformAgnostic ==
2349+ if (getPlatformAgnosticAvailability () ==
23492350 PlatformAgnosticAvailabilityKind::PackageDescriptionVersionSpecific)
23502351 {
2351- assert (Platform == PlatformKind::none &&
2352+ assert (getPlatform () == PlatformKind::none &&
23522353 (Introduced.has_value () ||
23532354 Deprecated.has_value () ||
23542355 Obsoleted.has_value ()));
@@ -2358,7 +2359,7 @@ bool AvailableAttr::isPackageDescriptionVersionSpecific() const {
23582359}
23592360
23602361bool AvailableAttr::isUnconditionallyUnavailable () const {
2361- switch (PlatformAgnostic ) {
2362+ switch (getPlatformAgnosticAvailability () ) {
23622363 case PlatformAgnosticAvailabilityKind::None:
23632364 case PlatformAgnosticAvailabilityKind::Deprecated:
23642365 case PlatformAgnosticAvailabilityKind::SwiftVersionSpecific:
@@ -2375,7 +2376,7 @@ bool AvailableAttr::isUnconditionallyUnavailable() const {
23752376}
23762377
23772378bool AvailableAttr::isUnconditionallyDeprecated () const {
2378- switch (PlatformAgnostic ) {
2379+ switch (getPlatformAgnosticAvailability () ) {
23792380 case PlatformAgnosticAvailabilityKind::None:
23802381 case PlatformAgnosticAvailabilityKind::Unavailable:
23812382 case PlatformAgnosticAvailabilityKind::UnavailableInSwift:
@@ -2392,7 +2393,8 @@ bool AvailableAttr::isUnconditionallyDeprecated() const {
23922393}
23932394
23942395bool AvailableAttr::isNoAsync () const {
2395- return PlatformAgnostic == PlatformAgnosticAvailabilityKind::NoAsync;
2396+ return getPlatformAgnosticAvailability () ==
2397+ PlatformAgnosticAvailabilityKind::NoAsync;
23962398}
23972399
23982400llvm::VersionTuple AvailableAttr::getActiveVersion (const ASTContext &ctx) const {
0 commit comments