[Serialization] Remove treatAsPartialModule parameter

This information can be derived from whether we're
installing the module file into the main module.
This commit is contained in:
Hamish Knight
2020-05-28 12:09:10 -07:00
parent c98c862e7e
commit f810cfcc45
6 changed files with 20 additions and 27 deletions

View File

@@ -1977,9 +1977,7 @@ ModuleFile::ModuleFile(
}
}
Status ModuleFile::associateWithFileContext(FileUnit *file,
SourceLoc diagLoc,
bool treatAsPartialModule) {
Status ModuleFile::associateWithFileContext(FileUnit *file, SourceLoc diagLoc) {
PrettyStackTraceModuleFile stackEntry(*this);
assert(!hasError() && "error already detected; should not call this");
@@ -2033,8 +2031,12 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
continue;
}
// If this module file is being installed into the main module, it's treated
// as a partial module.
auto isPartialModule = M->isMainModule();
if (dependency.isImplementationOnly() &&
!(treatAsPartialModule || ctx.LangOpts.DebuggerSupport)) {
!(isPartialModule || ctx.LangOpts.DebuggerSupport)) {
// When building normally (and not merging partial modules), we don't
// want to bring in the implementation-only module, because that might
// change the set of visible declarations. However, when debugging we