Skip to content

AST: Platform-specific fixes for -unavailable-decl-optimization #79248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Feb 9, 2025

Add support for -unavailable-decl-optimization on visionOS and on macOS for zippered libraries. It was previously disabled because of the complexity of correctly handling ABI compatibility with iOS in these contexts. The algorithm for determining whether a declaration is unreachable at runtime due to unavailability has been rewritten to account for platforms with ABI compatible ancestor platforms.

Resolves rdar://116742214 and rdar://125930716.

One to get the active domain for the compilation target and another to get the
ABI compatibility domain for a given domain. The ABI compatibility domain will
be needed for queries that compute whether an unavailable declaration is still
reachable at runtime.

NFC.
Using availability domains, reimplement the algorithm that determines whether a
declaration is unavailable at runtime. The new algorithm takes ABI compatible
platforms into account, ensuring that declarations that are available on iOS do
not get treated as unreachable at runtime when compiling for visionOS.

Resolves rdar://116742214.
Correct the determination of whether a declaration is unreachable at runtime
when compiling a zippered library.

Resolves rdar://125930716.
It's no longer used after the rewrite of the algorithm for determining if a
declaration is unreachable at runtime.
@tshortli tshortli force-pushed the abi-compatible-platform-decl-reachability branch from 01a035e to 670bfc0 Compare February 9, 2025 19:21
@tshortli tshortli marked this pull request as ready for review February 9, 2025 19:25
@tshortli
Copy link
Contributor Author

tshortli commented Feb 9, 2025

@swift-ci please test

@tshortli tshortli enabled auto-merge February 9, 2025 23:30
@tshortli tshortli merged commit 0225964 into swiftlang:main Feb 10, 2025
4 of 5 checks passed
@tshortli tshortli deleted the abi-compatible-platform-decl-reachability branch February 10, 2025 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant