-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Macros] Code item macros #64765
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
[Macros] Code item macros #64765
Conversation
@swift-ci please smoke test |
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
@swift-ci please smoke test |
if (auto *substituteDecl = E->getSubstituteDecl()) { | ||
if (doIt(substituteDecl)) | ||
return nullptr; | ||
// Visiting the substitute macro expansion decl will visit the same | ||
// argument list. Skip visiting it again. | ||
shouldWalkArguments = false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DougGregor Because a MacroExpansionExpr
and its substitute decl are sharing the argument list again after 1ba7c14
, this became necessary to prevent the argument list from being visited twice. Otherwise it triggers an assertion failure in VarDeclUsageChecker
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This localized suppression of visiting the argument list makes sense to me, thanks for pointing it out.
@swift-ci please smoke test |
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please test |
@swift-ci please smoke test |
Add support for declaring and expanding code item macros. Add experimental feature flag `CodeItemMacros`.
@swift-ci please smoke test |
Add support for declaring and expanding code item macros.
rdar://106326121