@@ -66,7 +66,7 @@ AvailabilityRange AvailabilityRange::forRuntimeTarget(const ASTContext &Ctx) {
6666}
6767
6868PlatformKind AvailabilityConstraint::getPlatform () const {
69- return attr->Platform ;
69+ return attr->getPlatform () ;
7070}
7171
7272std::optional<AvailabilityRange>
@@ -94,10 +94,10 @@ bool AvailabilityConstraint::isConditionallySatisfiable() const {
9494}
9595
9696bool AvailabilityConstraint::isActiveForRuntimeQueries (ASTContext &ctx) const {
97- if (attr->Platform == PlatformKind::none)
97+ if (attr->getPlatform () == PlatformKind::none)
9898 return true ;
9999
100- return swift::isPlatformActive (attr->Platform , ctx.LangOpts ,
100+ return swift::isPlatformActive (attr->getPlatform () , ctx.LangOpts ,
101101 /* forTargetVariant=*/ false ,
102102 /* forRuntimeQuery=*/ true );
103103}
@@ -220,14 +220,14 @@ void AvailabilityInference::applyInferredAvailableAttrs(
220220 // Skip an attribute from an outer declaration if it is for a platform
221221 // that was already handled implicitly by an attribute from an inner
222222 // declaration.
223- if (llvm::any_of (MergedAttrs,
224- [&AvAttr](const AvailableAttr *MergedAttr) {
225- return inheritsAvailabilityFromPlatform (
226- AvAttr->Platform , MergedAttr->Platform );
227- }))
223+ if (llvm::any_of (
224+ MergedAttrs, [&AvAttr](const AvailableAttr *MergedAttr) {
225+ return inheritsAvailabilityFromPlatform (
226+ AvAttr->getPlatform () , MergedAttr->getPlatform () );
227+ }))
228228 continue ;
229229
230- mergeWithInferredAvailability (AvAttr, Inferred[AvAttr->Platform ]);
230+ mergeWithInferredAvailability (AvAttr, Inferred[AvAttr->getPlatform () ]);
231231 PendingAttrs.push_back (AvAttr);
232232
233233 if (Message.empty () && !AvAttr->Message .empty ())
@@ -302,12 +302,12 @@ static bool isBetterThan(const AvailableAttr *newAttr,
302302 return true ;
303303
304304 // If they belong to the same platform, the one that introduces later wins.
305- if (prevAttr->Platform == newAttr->Platform )
305+ if (prevAttr->getPlatform () == newAttr->getPlatform () )
306306 return prevAttr->Introduced .value () < newAttr->Introduced .value ();
307307
308308 // If the new attribute's platform inherits from the old one, it wins.
309- return inheritsAvailabilityFromPlatform (newAttr->Platform ,
310- prevAttr->Platform );
309+ return inheritsAvailabilityFromPlatform (newAttr->getPlatform () ,
310+ prevAttr->getPlatform () );
311311}
312312
313313static const clang::DarwinSDKInfo::RelatedTargetVersionMapping *
@@ -348,7 +348,8 @@ bool AvailabilityInference::updateIntroducedPlatformForFallback(
348348 const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform,
349349 llvm::VersionTuple &PlatformVer) {
350350 std::optional<llvm::VersionTuple> IntroducedVersion = attr->Introduced ;
351- if (attr->Platform == PlatformKind::iOS && IntroducedVersion.has_value () &&
351+ if (attr->getPlatform () == PlatformKind::iOS &&
352+ IntroducedVersion.has_value () &&
352353 isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
353354 // We re-map the iOS introduced version to the corresponding visionOS version
354355 auto PotentiallyRemappedIntroducedVersion =
@@ -367,7 +368,8 @@ bool AvailabilityInference::updateDeprecatedPlatformForFallback(
367368 const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform,
368369 llvm::VersionTuple &PlatformVer) {
369370 std::optional<llvm::VersionTuple> DeprecatedVersion = attr->Deprecated ;
370- if (attr->Platform == PlatformKind::iOS && DeprecatedVersion.has_value () &&
371+ if (attr->getPlatform () == PlatformKind::iOS &&
372+ DeprecatedVersion.has_value () &&
371373 isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
372374 // We re-map the iOS deprecated version to the corresponding visionOS version
373375 auto PotentiallyRemappedDeprecatedVersion =
@@ -386,7 +388,8 @@ bool AvailabilityInference::updateObsoletedPlatformForFallback(
386388 const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform,
387389 llvm::VersionTuple &PlatformVer) {
388390 std::optional<llvm::VersionTuple> ObsoletedVersion = attr->Obsoleted ;
389- if (attr->Platform == PlatformKind::iOS && ObsoletedVersion.has_value () &&
391+ if (attr->getPlatform () == PlatformKind::iOS &&
392+ ObsoletedVersion.has_value () &&
390393 isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
391394 // We re-map the iOS obsoleted version to the corresponding visionOS version
392395 auto PotentiallyRemappedObsoletedVersion =
@@ -403,7 +406,7 @@ bool AvailabilityInference::updateObsoletedPlatformForFallback(
403406
404407void AvailabilityInference::updatePlatformStringForFallback (
405408 const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform) {
406- if (attr->Platform == PlatformKind::iOS &&
409+ if (attr->getPlatform () == PlatformKind::iOS &&
407410 isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
408411 Platform = swift::prettyPlatformString (PlatformKind::visionOS);
409412 }
@@ -525,7 +528,7 @@ bool Decl::isUnreachableAtRuntime() const {
525528 return false ;
526529
527530 // Universally unavailable declarations are always unreachable.
528- if (unavailableAttr->Platform == PlatformKind::none)
531+ if (unavailableAttr->getPlatform () == PlatformKind::none)
529532 return true ;
530533
531534 // FIXME: Support zippered frameworks (rdar://125371621)
0 commit comments