Skip to content

Add a -reflection-metadata-for-debugger-only flag that emits reflection metadata but does not link them from runtime data structures #40853

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

kubamracek
Copy link
Contributor

@kubamracek kubamracek commented Jan 14, 2022

Currently, the compiler can avoid emitting reflection metadata with -disable-reflection-metadata flag. The interesting goal of this is that this reduces binary size, as the reflection record (field names, etc.) are not present. Unfortunately, this also basically breaks all debugging. This PR introduces a "middle option" -- the compiler emits the reflection metadata that is consumed by the compiler, but those records are not linked/referenced from the runtime metadata records, therefore they can be captured as a separate build step, and then stripped by the linker (they are unreferenced by anything). That's that this new -reflection-metadata-for-debugger-only flag does.

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@adrian-prantl
Copy link
Contributor

Could we add some form of test for this?

@kubamracek kubamracek force-pushed the reflection-metadata-for-debugger-only branch from c2af8a2 to 316eaf7 Compare February 2, 2022 20:11
…on metadata but does not link them from runtime data structures
@kubamracek kubamracek force-pushed the reflection-metadata-for-debugger-only branch from 316eaf7 to 0b677e0 Compare February 2, 2022 23:28
@kubamracek
Copy link
Contributor Author

Added test!

@kubamracek
Copy link
Contributor Author

@swift-ci please test

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