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