Skip to content

Add support for 'union' symbol kinds #785

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 4 commits into from
Feb 1, 2024

Conversation

QuietMisdreavus
Copy link
Contributor

Bug/issue #, if applicable: rdar://120374980

Summary

Clang's upcoming C++ support changed how C unions are represented in the symbol graph by giving them their own union symbol kind. This PR adds support for dedicated union symbols.

Dependencies

swiftlang/swift-docc-symbolkit#68

Testing

Support for union symbols is currently only available on Clang's main branch, where its C++ support was added. Additionally, it appears that union symbols are only properly generated for C++ code, rather than C code. The CxxNamespaces test bundle i added last month for C++ namespaces has been renamed into CxxSymbols, and a MyUnion symbol has been added to it. It can be used in lieu of building Clang yourself.

Steps:

  1. swift run docc preview Tests/SwiftDocCTests/Test\ Bundles/CxxSymbols.docc
  2. Load the preview, and ensure that the MyUnion symbol is properly curated under the "Unions" header in the landing page.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • [ n/a ] Updated documentation if necessary

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@daniel-grumberg
Copy link
Contributor

PR for fixing the C/Obj-C SGF generation llvm/llvm-project#77451

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus QuietMisdreavus merged commit 53aa1ae into swiftlang:main Feb 1, 2024
@QuietMisdreavus QuietMisdreavus deleted the union-kind branch February 1, 2024 18: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