[Serialization] Retire "shadowed module" in favor of "underlying" (#24711)

Similar to 517f5d6b6a, the "shadowed" terminology didn't end up
describing the most common use of the feature; there is pretty much no
intended case where a Swift module shadows a Clang module without also
re-exporting it. Switch to "underlying", which was already in use in a
few places, and which better parallels "overlay".

No intended functionality change.
This commit is contained in:
Jordan Rose
2019-05-13 10:20:03 -07:00
committed by GitHub
parent b903f7191d
commit 6cca050fd9
6 changed files with 22 additions and 22 deletions

View File

@@ -1570,10 +1570,10 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
}
auto module = getModule(modulePath, /*allowLoading*/true);
if (!module || module->failedToLoad()) {
// If we're missing the module we're shadowing, treat that specially.
// If we're missing the module we're an overlay for, treat that specially.
if (modulePath.size() == 1 &&
modulePath.front() == file->getParentModule()->getName()) {
return error(Status::MissingShadowedModule);
return error(Status::MissingUnderlyingModule);
}
// Otherwise, continue trying to load dependencies, so that we can list
@@ -1720,10 +1720,10 @@ TypeDecl *ModuleFile::lookupNestedType(Identifier name,
}
}
if (!ShadowedModule)
if (!UnderlyingModule)
return nullptr;
for (FileUnit *file : ShadowedModule->getFiles())
for (FileUnit *file : UnderlyingModule->getFiles())
if (auto *nestedType = file->lookupNestedType(name, parent))
return nestedType;
@@ -2195,8 +2195,8 @@ ModuleFile::getOpaqueReturnTypeDecls(SmallVectorImpl<OpaqueTypeDecl *> &results)
}
void ModuleFile::getDisplayDecls(SmallVectorImpl<Decl *> &results) {
if (ShadowedModule)
ShadowedModule->getDisplayDecls(results);
if (UnderlyingModule)
UnderlyingModule->getDisplayDecls(results);
PrettyStackTraceModuleFile stackEntry(*this);
getImportDecls(results);