mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Return a SemanticAvailableAttr from Decl::getDeprecatedAttr().
This commit is contained in:
@@ -3215,6 +3215,16 @@ public:
|
||||
/// `PlatformKind::none` if the attribute is not platform specific.
|
||||
PlatformKind getPlatform() const { return getDomain().getPlatformKind(); }
|
||||
|
||||
/// Whether this is attribute indicates unavailability in all versions.
|
||||
bool isUnconditionallyUnavailable() const {
|
||||
return attr->isUnconditionallyUnavailable();
|
||||
}
|
||||
|
||||
/// Whether this is attribute indicates deprecation in all versions.
|
||||
bool isUnconditionallyDeprecated() const {
|
||||
return attr->isUnconditionallyDeprecated();
|
||||
}
|
||||
|
||||
/// Whether this is a `noasync` attribute.
|
||||
bool isNoAsync() const { return attr->isNoAsync(); }
|
||||
|
||||
|
||||
@@ -1416,15 +1416,15 @@ public:
|
||||
|
||||
/// Returns true if the declaration is deprecated at the current deployment
|
||||
/// target.
|
||||
bool isDeprecated() const { return getDeprecatedAttr() != nullptr; }
|
||||
bool isDeprecated() const { return getDeprecatedAttr().has_value(); }
|
||||
|
||||
/// Returns the first `@available` attribute that indicates that this decl
|
||||
/// is deprecated on current deployment target, or `nullptr` otherwise.
|
||||
const AvailableAttr *getDeprecatedAttr() const;
|
||||
std::optional<SemanticAvailableAttr> getDeprecatedAttr() const;
|
||||
|
||||
/// Returns the first `@available` attribute that indicates that this decl
|
||||
/// will be deprecated in the future, or `nullptr` otherwise.
|
||||
const AvailableAttr *getSoftDeprecatedAttr() const;
|
||||
std::optional<SemanticAvailableAttr> getSoftDeprecatedAttr() const;
|
||||
|
||||
/// Returns the first @available attribute that indicates this decl is
|
||||
/// unavailable from asynchronous contexts, or `nullptr` otherwise.
|
||||
|
||||
Reference in New Issue
Block a user