AST: Introduce a Swift runtime availability domain.

Add support for the `Swift` availability domain, which represents availability
with respect to the Swift runtime. Use of this domain is restricted by the
experimental feature `SwiftRuntimeAvailability`.
This commit is contained in:
Allan Shortlidge
2025-10-07 22:38:41 -07:00
parent 2d8465b043
commit 1a86cd9c26
19 changed files with 213 additions and 48 deletions

View File

@@ -869,11 +869,12 @@ private:
return AvailabilityQuery::dynamic(variantSpec->getDomain(), primaryRange,
variantRange);
case AvailabilityDomain::Kind::SwiftRuntime:
case AvailabilityDomain::Kind::Platform:
// Platform checks are always dynamic. The SIL optimizer is responsible
// eliminating these checks when it can prove that they can never fail
// (due to the deployment target). We can't perform that analysis here
// because it may depend on inlining.
// Platform and Swift runtime checks are always dynamic. The SIL optimizer
// is responsible eliminating these checks when it can prove that they can
// never fail (due to the deployment target). We can't perform that
// analysis here because it may depend on inlining.
return AvailabilityQuery::dynamic(domain, primaryRange, variantRange);
case AvailabilityDomain::Kind::Custom:
auto customDomain = domain.getCustomDomain();