[APIGen] Handle SPI availability for nested decls (#85048)

- Add SPI availability information to `APIAvailability` from attribute
`@_spi_available`.
- Correctly obtain effective availability for nested declarations
without immediate availability attributes.

Resolves rdar://159702280

<!--
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!
-->
This commit is contained in:
Zixu Wang
2025-11-04 11:34:05 -08:00
committed by GitHub
parent b6c29f1ce6
commit 18a9d7002f
7 changed files with 383 additions and 296 deletions

View File

@@ -28,7 +28,8 @@ public struct TestStruct {
// CHECK-NEXT: "name": "_$s8MyModule10TestStructVACycfC",
// CHECK-NEXT: "access": "public",
// CHECK-NEXT: "file": "SOURCE_DIR/test/APIJSON/struct.swift",
// CHECK-NEXT: "linkage": "exported"
// CHECK-NEXT: "linkage": "exported",
// CHECK-NEXT: "introduced": "10.13"
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT: "name": "_$s8MyModule10TestStructVMa",