Skip to content

[APIGen] Don't record declarations from clang header files #81086

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 2 commits into from
Apr 30, 2025

Conversation

zixu-w
Copy link
Contributor

@zixu-w zixu-w commented Apr 25, 2025

When Swift visits an ExtensionDecl from an @objc @implementation extension, it fetches the implemented Objective-C interface declaration from the header file and adds to the visitor.
We don't want these API records from APIGenRecorder for Swift API descriptor, because we cannot correctly reason about their API access as they depend on the header group which Swift doesn't know about.

Resolves rdar://148943382

When Swift visits an `ExtensionDecl` from an `@objc @implementation`
extension, it fetches the implemented Objective-C interface declaration
from the header file and adds to the visitor.
We don't want these API records from `APIGenRecorder` for Swift API
descriptor, because we cannot correctly reason about their API access as
they depend on the header group which Swift doesn't know about.

Resolves rdar://148943382
@zixu-w zixu-w requested review from tshortli and cyndyishida April 25, 2025 01:22
@zixu-w zixu-w requested a review from rjmccall as a code owner April 25, 2025 01:22
@zixu-w
Copy link
Contributor Author

zixu-w commented Apr 28, 2025

@swift-ci please test

@zixu-w
Copy link
Contributor Author

zixu-w commented Apr 30, 2025

@swift-ci please smoke test macOS

@zixu-w zixu-w merged commit cd54530 into swiftlang:main Apr 30, 2025
4 of 5 checks passed
@zixu-w zixu-w deleted the apigen-skip-clang-decls branch April 30, 2025 22:40
zixu-w added a commit to zixu-w/swift that referenced this pull request Apr 30, 2025
…#81086)

When Swift visits an `ExtensionDecl` from an `@objc @implementation`
extension, it fetches the implemented Objective-C interface declaration
from the header file and adds to the visitor.
We don't want these API records from `APIGenRecorder` for Swift API
descriptor, because we cannot correctly reason about their API access as
they depend on the header group which Swift doesn't know about.

Resolves rdar://148943382

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->

(cherry picked from commit cd54530)
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