Skip to content

[Macros] Adjust starting context for macro expansion mangling #65469

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

@DougGregor DougGregor commented Apr 27, 2023

  • Explanation: Eliminate another circular reference through macro expansion mangling by adjusting the starting declaration context to ensure that it is from a suitable "outer" context. While here, make sure we introduce private discriminators for expression macro manglings, so they don't conflict across source files.
  • Scope: Only affects the mangling of macro expansion buffers in narrow cases, i.e., when they occur within a property initializer.
  • Risk: Low, no effect in code that doesn't use macros, and this is a small adjustment to the context calculation for a case where the
  • Issue: rdar://108511666
  • Original pull request: [Macros] Adjust starting context for macro expansion mangling #65468

Eliminate another circular reference through macro expansion mangling
by adjusting the starting declaration context to ensure that it is from
a suitable "outer" context.

Fixes rdar://108511666.
@DougGregor DougGregor requested a review from a team as a code owner April 27, 2023 17:38
@DougGregor
Copy link
Member Author

@swift-ci please test

Expression macros ascribed to non-private contexts need private
discriminators so they don't conflict with other uses of the same macro
in other source files.

Thank you, Richard, for noticing this omission!
@DougGregor
Copy link
Member Author

@swift-ci please test

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit 94903f0 into swiftlang:release/5.9 Apr 28, 2023
@DougGregor DougGregor deleted the macro-mangle-not-initializer-5.9 branch April 28, 2023 13:35
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants