[Macros] Ensure that name lookup can find uniquely-generated macro names

While a Swift program cannot directly utter one of the unique names
produced by the macro expansion context outside of the macro itself,
utilities such as type reconstruction require the ability to look up
these names. Note that various kinds of macros can introduce unique
names, and update the name lookup facilities for macro-generated names
to account for them.

Fixes rdar://106053984.
This commit is contained in:
Doug Gregor
2023-03-07 11:31:27 -08:00
parent 8b63ce8273
commit 3c779e7405
5 changed files with 83 additions and 5 deletions

View File

@@ -6137,7 +6137,8 @@ void Serializer::writeAST(ModuleOrSourceFile DC) {
for (auto D : fileDecls) {
if (isa<ImportDecl>(D) || isa<IfConfigDecl>(D) ||
isa<PoundDiagnosticDecl>(D) || isa<TopLevelCodeDecl>(D)) {
isa<PoundDiagnosticDecl>(D) || isa<TopLevelCodeDecl>(D) ||
isa<MacroExpansionDecl>(D)) {
continue;
}