Ensure that we serialize declarations in synthesized files

Without this, conformances synthesized by macros aren't visible
across modules.

Fixes rdar://109051626.
This commit is contained in:
Doug Gregor
2023-05-08 22:21:21 -07:00
parent fc9d97fe68
commit d30feef92f
2 changed files with 29 additions and 4 deletions

View File

@@ -6230,7 +6230,12 @@ void Serializer::writeAST(ModuleOrSourceFile DC) {
Scratch.push_back(synthesizedFile);
files = llvm::makeArrayRef(Scratch);
} else {
files = M->getFiles();
for (auto file : M->getFiles()) {
Scratch.push_back(file);
if (auto *synthesizedFile = file->getSynthesizedFile())
Scratch.push_back(synthesizedFile);
}
files = llvm::makeArrayRef(Scratch);
}
for (auto nextFile : files) {
if (nextFile->hasEntryPoint())