@@ -3757,41 +3757,71 @@ class SemanticAvailableAttr final {
37573757 // / The source range of the `introduced:` version component.
37583758 SourceRange getIntroducedSourceRange () const { return attr->IntroducedRange ; }
37593759
3760- // / Returns the effective introduction range indicated by this attribute.
3761- // / This may correspond to the version specified by the `introduced:`
3762- // / component (remapped or canonicalized if necessary) or it may be "always"
3763- // / for an attribute indicating availability in a version-less domain. Returns
3764- // / `std::nullopt` if the attribute does not indicate introduction.
3760+ // / See `getIntroducedDomainAndRange()`.
37653761 std::optional<AvailabilityRange>
3766- getIntroducedRange (const ASTContext &Ctx) const ;
3762+ getIntroducedRange (const ASTContext &ctx) const {
3763+ if (auto domainAndRange = getIntroducedDomainAndRange (ctx))
3764+ return domainAndRange->getRange ();
3765+ return std::nullopt ;
3766+ }
3767+
3768+ // / Returns the effective introduction range indicated by this attribute,
3769+ // / along with the domain that it applies to (which may be different than the
3770+ // / domain which the attribute was written with if a remap is required). This
3771+ // / may correspond to the version specified by the `introduced:` component
3772+ // / (remapped or canonicalized if necessary) or it may be "always" for an
3773+ // / attribute indicating availability in a version-less domain. Returns
3774+ // / `std::nullopt` if the attribute does not indicate introduction.
3775+ std::optional<AvailabilityDomainAndRange>
3776+ getIntroducedDomainAndRange (const ASTContext &ctx) const ;
37673777
37683778 // / The version tuple for the `deprecated:` component.
37693779 std::optional<llvm::VersionTuple> getDeprecated () const ;
37703780
37713781 // / The source range of the `deprecated:` version component.
37723782 SourceRange getDeprecatedSourceRange () const { return attr->DeprecatedRange ; }
37733783
3774- // / Returns the effective deprecation range indicated by this attribute.
3775- // / This may correspond to the version specified by the `deprecated:`
3776- // / component (remapped or canonicalized if necessary) or it may be "always"
3777- // / for an unconditional deprecation attribute. Returns `std::nullopt` if the
3778- // / attribute does not indicate deprecation.
3784+ // / See `getDeprecatedDomainAndRange()`.
37793785 std::optional<AvailabilityRange>
3780- getDeprecatedRange (const ASTContext &Ctx) const ;
3786+ getDeprecatedRange (const ASTContext &ctx) const {
3787+ if (auto domainAndRange = getDeprecatedDomainAndRange (ctx))
3788+ return domainAndRange->getRange ();
3789+ return std::nullopt ;
3790+ }
3791+
3792+ // / Returns the effective deprecation range indicated by this attribute, along
3793+ // / with the domain that it applies to (which may be different than the domain
3794+ // / which the attribute was written with if a remap is required). This may
3795+ // / correspond to the version specified by the `deprecated:` component
3796+ // / (remapped or canonicalized if necessary) or it may be "always" for an
3797+ // / unconditional deprecation attribute. Returns `std::nullopt` if the
3798+ // / attribute does not indicate deprecation.
3799+ std::optional<AvailabilityDomainAndRange>
3800+ getDeprecatedDomainAndRange (const ASTContext &ctx) const ;
37813801
37823802 // / The version tuple for the `obsoleted:` component.
37833803 std::optional<llvm::VersionTuple> getObsoleted () const ;
37843804
37853805 // / The source range of the `obsoleted:` version component.
37863806 SourceRange getObsoletedSourceRange () const { return attr->ObsoletedRange ; }
37873807
3788- // / Returns the effective obsoletion range indicated by this attribute.
3789- // / This always corresponds to the version specified by the `obsoleted:`
3790- // / component (remapped or canonicalized if necessary). Returns `std::nullopt`
3791- // / if the attribute does not indicate obsoletion (note that unavailability is
3792- // / separate from obsoletion.
3808+ // / See `getObsoletedDomainAndRange()`.
37933809 std::optional<AvailabilityRange>
3794- getObsoletedRange (const ASTContext &Ctx) const ;
3810+ getObsoletedRange (const ASTContext &ctx) const {
3811+ if (auto domainAndRange = getObsoletedDomainAndRange (ctx))
3812+ return domainAndRange->getRange ();
3813+ return std::nullopt ;
3814+ }
3815+
3816+ // / Returns the effective obsoletion range indicated by this attribute, along
3817+ // / with the domain that it applies to (which may be different than the domain
3818+ // / which the attribute was written with if a remap is required). This always
3819+ // / corresponds to the version specified by the `obsoleted:` component
3820+ // / (remapped or canonicalized if necessary). Returns `std::nullopt` if the
3821+ // / attribute does not indicate obsoletion (note that unavailability is
3822+ // / separate from obsoletion.
3823+ std::optional<AvailabilityDomainAndRange>
3824+ getObsoletedDomainAndRange (const ASTContext &ctx) const ;
37953825
37963826 // / Returns the `message:` field of the attribute, or an empty string.
37973827 StringRef getMessage () const { return attr->Message ; }
0 commit comments