Skip to content

[Macros] Use macro expansion mangling for unique names in macros #63322

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

DougGregor
Copy link
Member

Use the name mangling scheme we've devised for macro expansions to
back the implementation of the macro expansion context's
getUniqueName operation. This way, we guarantee that the names
provided by macro expansions don't conflict, as well as making them
demangleable so we can determine what introduced the names.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

swiftlang/swift-driver#1281

@swift-ci please smoke test macOS

Add frontend flag `-emit-macro-expansion-files diagnostics` to emit any
macro expansion buffers referenced by diagnostics into files in a
temporary directory. This makes debugging type-checking failures in
macro expansions far easier, because you can see them after the
compiler process has exited.
This feature is too handy to leave off-by-default. Enable it by
default, but allow `-emit-macro-expansion-files no-diagnostics` to
disable it.
Use the name mangling scheme we've devised for macro expansions to
back the implementation of the macro expansion context's
`getUniqueName` operation. This way, we guarantee that the names
provided by macro expansions don't conflict, as well as making them
demangleable so we can determine what introduced the names.
@DougGregor DougGregor force-pushed the macro-expansion-unique-name-mangling branch from 834864f to 6905bc0 Compare January 31, 2023 17:55
@DougGregor
Copy link
Member Author

swiftlang/swift-driver#1281

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

@xedin xedin removed their request for review January 31, 2023 21:26
@DougGregor DougGregor merged commit 0af3523 into swiftlang:main Feb 1, 2023
@DougGregor DougGregor deleted the macro-expansion-unique-name-mangling branch February 1, 2023 04:17
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.

1 participant