Skip to content

Conversation

@egorzhdan
Copy link
Contributor

This is similar to ced4cb0.

Clang stores macro information for each identifier inside of IdentifierInfo, which can sometimes get outdated. Clang solves this by updating the identifier info if necessary in getLeafModuleMacros. Let's do the same in Swift.

This makes sure that macros that reference other macros are correctly imported with C++ interop enabled.

rdar://145584369
rdar://110071334

This is similar to ced4cb0.

Clang stores macro information for each identifier inside of `IdentifierInfo`, which can sometimes get outdated. Clang solves this by updating the identifier info if necessary in `getLeafModuleMacros`. Let's do the same in Swift.

This makes sure that macros that reference other macros are correctly imported with C++ interop enabled.

rdar://145584369
rdar://110071334
@egorzhdan egorzhdan force-pushed the egorzhdan/macro-out-of-date branch from 0ce9b3f to 3c82042 Compare September 12, 2025 16:43
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan merged commit 61db988 into swiftlang:main Sep 12, 2025
3 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/macro-out-of-date branch September 15, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ interop Feature: Interoperability with C++

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants