Commit Graph

3 Commits

Author SHA1 Message Date
Rintaro Ishizaki
86d405bcd0 [Macros] Unify MacroExpansionDecl/MacroExpansionExpr expansion logic
'MacroExpansionDecl' and 'MacroExpansionExpr' have many common methods.
Introduce a common base class 'FreestandingMacroExpansion' that holds
'MacroExpansionInfo'.

Factor out common expansion logic to 'evaluateFreestandingMacro'
function that resembles 'evaluateAttachedMacro'.
2023-06-02 11:54:05 -07:00
Doug Gregor
101f018bc0 [Macros] Adjust starting context for macro expansion mangling
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.
2023-04-27 10:16:02 -07:00
Doug Gregor
72ddbebc08 [Macros] Assign macro expansion discriminators more lazily.
This is a punt. They'll be unique, and they'll be per-context, but
they'll be lazy and therefore not stable.
2023-01-25 22:03:38 -08:00