mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user