@@ -345,10 +345,10 @@ getRemappedDeprecatedObsoletedVersionForFallbackPlatform(
345345}
346346
347347bool AvailabilityInference::updateIntroducedPlatformForFallback (
348- const AvailableAttr * attr, const ASTContext &Ctx, llvm::StringRef &Platform ,
349- llvm::VersionTuple &PlatformVer) {
350- std::optional<llvm::VersionTuple> IntroducedVersion = attr-> Introduced ;
351- if (attr-> getPlatform () == PlatformKind::iOS &&
348+ const SemanticAvailableAttr & attr, const ASTContext &Ctx,
349+ llvm::StringRef &Platform, llvm:: VersionTuple &PlatformVer) {
350+ std::optional<llvm::VersionTuple> IntroducedVersion = attr. getIntroduced () ;
351+ if (attr. getPlatform () == PlatformKind::iOS &&
352352 IntroducedVersion.has_value () &&
353353 isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
354354 // We re-map the iOS introduced version to the corresponding visionOS version
@@ -365,10 +365,10 @@ bool AvailabilityInference::updateIntroducedPlatformForFallback(
365365}
366366
367367bool AvailabilityInference::updateDeprecatedPlatformForFallback (
368- const AvailableAttr * attr, const ASTContext &Ctx, llvm::StringRef &Platform ,
369- llvm::VersionTuple &PlatformVer) {
370- std::optional<llvm::VersionTuple> DeprecatedVersion = attr-> Deprecated ;
371- if (attr-> getPlatform () == PlatformKind::iOS &&
368+ const SemanticAvailableAttr & attr, const ASTContext &Ctx,
369+ llvm::StringRef &Platform, llvm:: VersionTuple &PlatformVer) {
370+ std::optional<llvm::VersionTuple> DeprecatedVersion = attr. getDeprecated () ;
371+ if (attr. getPlatform () == PlatformKind::iOS &&
372372 DeprecatedVersion.has_value () &&
373373 isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
374374 // We re-map the iOS deprecated version to the corresponding visionOS version
@@ -385,11 +385,10 @@ bool AvailabilityInference::updateDeprecatedPlatformForFallback(
385385}
386386
387387bool AvailabilityInference::updateObsoletedPlatformForFallback (
388- const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform,
389- llvm::VersionTuple &PlatformVer) {
390- std::optional<llvm::VersionTuple> ObsoletedVersion = attr->Obsoleted ;
391- if (attr->getPlatform () == PlatformKind::iOS &&
392- ObsoletedVersion.has_value () &&
388+ const SemanticAvailableAttr &attr, const ASTContext &Ctx,
389+ llvm::StringRef &Platform, llvm::VersionTuple &PlatformVer) {
390+ std::optional<llvm::VersionTuple> ObsoletedVersion = attr.getObsoleted ();
391+ if (attr.getPlatform () == PlatformKind::iOS && ObsoletedVersion.has_value () &&
393392 isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
394393 // We re-map the iOS obsoleted version to the corresponding visionOS version
395394 auto PotentiallyRemappedObsoletedVersion =
@@ -405,8 +404,9 @@ bool AvailabilityInference::updateObsoletedPlatformForFallback(
405404}
406405
407406void AvailabilityInference::updatePlatformStringForFallback (
408- const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform) {
409- if (attr->getPlatform () == PlatformKind::iOS &&
407+ const SemanticAvailableAttr &attr, const ASTContext &Ctx,
408+ llvm::StringRef &Platform) {
409+ if (attr.getPlatform () == PlatformKind::iOS &&
410410 isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
411411 Platform = swift::prettyPlatformString (PlatformKind::visionOS);
412412 }
@@ -531,8 +531,7 @@ std::optional<SemanticAvailableAttr> Decl::getDeprecatedAttr() const {
531531 StringRef deprecatedPlatform;
532532 llvm::VersionTuple remappedDeprecatedVersion;
533533 if (AvailabilityInference::updateDeprecatedPlatformForFallback (
534- attr.getParsedAttr (), ctx, deprecatedPlatform,
535- remappedDeprecatedVersion))
534+ attr, ctx, deprecatedPlatform, remappedDeprecatedVersion))
536535 deprecatedVersion = remappedDeprecatedVersion;
537536
538537 if (!deprecatedVersion.has_value ())
@@ -839,7 +838,7 @@ SemanticAvailableAttr::getIntroducedRange(const ASTContext &Ctx) const {
839838 StringRef Platform;
840839 llvm::VersionTuple RemappedIntroducedVersion;
841840 if (AvailabilityInference::updateIntroducedPlatformForFallback (
842- attr , Ctx, Platform, RemappedIntroducedVersion))
841+ * this , Ctx, Platform, RemappedIntroducedVersion))
843842 IntroducedVersion = RemappedIntroducedVersion;
844843
845844 return AvailabilityRange{VersionRange::allGTE (IntroducedVersion)};
0 commit comments