Files
Allan Shortlidge 37a98cc7d2 ClangImporter: Support serialization for Clang availability domain queries.
The fix implemented in https://github.com/swiftlang/swift/pull/85549 gave the
synthesized predicates for dynamic Clang availability domains `internal` access
levels in order to work around dangling references to synthesized Clang
declarations when deserializing SIL that referenced those predicates. That fix
was quickly followed up with https://github.com/swiftlang/swift/pull/85405
which made the predicates `private` instead to avoid duplicate symbols during
linking. Both of these changes unnecessarily restrict the availability queries
from appearing in inlinable function bodies, which is an important use case.
Better fixes would be to either synthesize the Clang predicate helper functions
consistently when the module owning the availability domains is loaded or to
avoid synthesizing the helper functions altogether. This fix takes the latter
approach, generating Swift code directly that calls the Clang predicate
function and allowing the Swift predicate function to be annotated
`@export(implementation)` which allows it to be referenced freely in serialized
SIL and de-duplicated at link time.

Resolves rdar://179126954.
2026-06-09 19:36:52 -07:00
..