Skip to content

TBDGen: Improve the accuracy of swift-api-extract output #68978

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
merged 6 commits into from
Oct 5, 2023

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Oct 5, 2023

The output of swift-api-extract had inaccurate visibility and availability for many symbols because APIRecorder did not consistently have access to a representative Decl to query for those attributes. We can plumb the currently visited Decl through from SILSymbolVisitor to provide more consistent context.

By adopting this new utility, swift-api-extract more reliably gets the
ValueDecl associated with a symbol and therefore reports more accurate
availability info.
This ensures that different kinds of declarations with the `@_spi_available`
attribute are handled consistently.
By plumbing the currently visited Decl through to APIRecorder we can improve
the correctness of API symbol visibility and availability in swift-api-extract
output.
@tshortli tshortli force-pushed the improve-api-extract-accuracy branch from 1d90dfa to 80b1f4c Compare October 5, 2023 05:11
@tshortli
Copy link
Contributor Author

tshortli commented Oct 5, 2023

@swift-ci please test

@tshortli tshortli marked this pull request as ready for review October 5, 2023 05:17
Copy link
Contributor

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tshortli tshortli merged commit 0b07c34 into swiftlang:main Oct 5, 2023
@tshortli tshortli deleted the improve-api-extract-accuracy branch October 5, 2023 17:49
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.

2 participants