[Serialization] Preserve @_implementationOnly through module merging

When we build incrementally, we produce "partial swiftmodules" for
each input source file, then merge them together into the final
compiled module that, among other things, gets used for debugging.
Without this, we'd drop @_implementationOnly imports and any types
from the modules that were imported during the module-merging step
and then be unable to debug those types
This commit is contained in:
Jordan Rose
2019-03-28 16:04:35 -07:00
parent 0ba6c495ba
commit 526ea54f43
7 changed files with 56 additions and 12 deletions

View File

@@ -1460,7 +1460,8 @@ ModuleFile::ModuleFile(
}
Status ModuleFile::associateWithFileContext(FileUnit *file,
SourceLoc diagLoc) {
SourceLoc diagLoc,
bool treatAsPartialModule) {
PrettyStackTraceModuleFile stackEntry(*this);
assert(getStatus() == Status::Valid && "invalid module file");
@@ -1513,7 +1514,7 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
continue;
}
if (dependency.isImplementationOnly())
if (dependency.isImplementationOnly() && !treatAsPartialModule)
continue;
StringRef modulePathStr = dependency.RawPath;