AST: Introduce Decl::isSemanticallyUnavailable().

Adopt it in a few places as a replacement for `Decl::getSemanticUnavailableAttr()`.
This commit is contained in:
Allan Shortlidge
2024-12-02 12:28:32 -08:00
parent 0ff25ca7b0
commit b2cc10cd94
6 changed files with 18 additions and 5 deletions

View File

@@ -1455,9 +1455,15 @@ public:
std::optional<std::pair<const AvailableAttr *, const Decl *>>
getSemanticUnavailableAttr(bool ignoreAppExtensions = false) const;
/// Returns true if the decl is effectively always unavailable in the current
/// compilation context. This query differs from \c isUnavailable() because it
/// takes the availability of parent declarations into account.
bool isSemanticallyUnavailable() const;
/// Returns true if code associated with this declaration should be considerd
/// unreachable at runtime because the declaration is unavailable in all
/// execution contexts in which the code may run.
/// execution contexts in which the code may run. This result takes the
/// availability of parent declarations into account.
bool isUnreachableAtRuntime() const;
/// Returns true if this declaration should be considered available during