@@ -3625,41 +3625,71 @@ class SemanticAvailableAttr final {
36253625 // / The source range of the `introduced:` version component.
36263626 SourceRange getIntroducedSourceRange () const { return attr->IntroducedRange ; }
36273627
3628- // / Returns the effective introduction range indicated by this attribute.
3629- // / This may correspond to the version specified by the `introduced:`
3630- // / component (remapped or canonicalized if necessary) or it may be "always"
3631- // / for an attribute indicating availability in a version-less domain. Returns
3632- // / `std::nullopt` if the attribute does not indicate introduction.
3628+ // / See `getIntroducedDomainAndRange()`.
36333629 std::optional<AvailabilityRange>
3634- getIntroducedRange (const ASTContext &Ctx) const ;
3630+ getIntroducedRange (const ASTContext &ctx) const {
3631+ if (auto domainAndRange = getIntroducedDomainAndRange (ctx))
3632+ return domainAndRange->getRange ();
3633+ return std::nullopt ;
3634+ }
3635+
3636+ // / Returns the effective introduction range indicated by this attribute,
3637+ // / along with the domain that it applies to (which may be different than the
3638+ // / domain which the attribute was written with if a remap is required). This
3639+ // / may correspond to the version specified by the `introduced:` component
3640+ // / (remapped or canonicalized if necessary) or it may be "always" for an
3641+ // / attribute indicating availability in a version-less domain. Returns
3642+ // / `std::nullopt` if the attribute does not indicate introduction.
3643+ std::optional<AvailabilityDomainAndRange>
3644+ getIntroducedDomainAndRange (const ASTContext &ctx) const ;
36353645
36363646 // / The version tuple for the `deprecated:` component.
36373647 std::optional<llvm::VersionTuple> getDeprecated () const ;
36383648
36393649 // / The source range of the `deprecated:` version component.
36403650 SourceRange getDeprecatedSourceRange () const { return attr->DeprecatedRange ; }
36413651
3642- // / Returns the effective deprecation range indicated by this attribute.
3643- // / This may correspond to the version specified by the `deprecated:`
3644- // / component (remapped or canonicalized if necessary) or it may be "always"
3645- // / for an unconditional deprecation attribute. Returns `std::nullopt` if the
3646- // / attribute does not indicate deprecation.
3652+ // / See `getDeprecatedDomainAndRange()`.
36473653 std::optional<AvailabilityRange>
3648- getDeprecatedRange (const ASTContext &Ctx) const ;
3654+ getDeprecatedRange (const ASTContext &ctx) const {
3655+ if (auto domainAndRange = getDeprecatedDomainAndRange (ctx))
3656+ return domainAndRange->getRange ();
3657+ return std::nullopt ;
3658+ }
3659+
3660+ // / Returns the effective deprecation range indicated by this attribute, along
3661+ // / with the domain that it applies to (which may be different than the domain
3662+ // / which the attribute was written with if a remap is required). This may
3663+ // / correspond to the version specified by the `deprecated:` component
3664+ // / (remapped or canonicalized if necessary) or it may be "always" for an
3665+ // / unconditional deprecation attribute. Returns `std::nullopt` if the
3666+ // / attribute does not indicate deprecation.
3667+ std::optional<AvailabilityDomainAndRange>
3668+ getDeprecatedDomainAndRange (const ASTContext &ctx) const ;
36493669
36503670 // / The version tuple for the `obsoleted:` component.
36513671 std::optional<llvm::VersionTuple> getObsoleted () const ;
36523672
36533673 // / The source range of the `obsoleted:` version component.
36543674 SourceRange getObsoletedSourceRange () const { return attr->ObsoletedRange ; }
36553675
3656- // / Returns the effective obsoletion range indicated by this attribute.
3657- // / This always corresponds to the version specified by the `obsoleted:`
3658- // / component (remapped or canonicalized if necessary). Returns `std::nullopt`
3659- // / if the attribute does not indicate obsoletion (note that unavailability is
3660- // / separate from obsoletion.
3676+ // / See `getObsoletedDomainAndRange()`.
36613677 std::optional<AvailabilityRange>
3662- getObsoletedRange (const ASTContext &Ctx) const ;
3678+ getObsoletedRange (const ASTContext &ctx) const {
3679+ if (auto domainAndRange = getObsoletedDomainAndRange (ctx))
3680+ return domainAndRange->getRange ();
3681+ return std::nullopt ;
3682+ }
3683+
3684+ // / Returns the effective obsoletion range indicated by this attribute, along
3685+ // / with the domain that it applies to (which may be different than the domain
3686+ // / which the attribute was written with if a remap is required). This always
3687+ // / corresponds to the version specified by the `obsoleted:` component
3688+ // / (remapped or canonicalized if necessary). Returns `std::nullopt` if the
3689+ // / attribute does not indicate obsoletion (note that unavailability is
3690+ // / separate from obsoletion.
3691+ std::optional<AvailabilityDomainAndRange>
3692+ getObsoletedDomainAndRange (const ASTContext &ctx) const ;
36633693
36643694 // / Returns the `message:` field of the attribute, or an empty string.
36653695 StringRef getMessage () const { return attr->Message ; }
0 commit comments