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:
@@ -562,7 +562,7 @@ FileUnit *SerializedModuleLoaderBase::loadAST(
|
||||
// necessarily mean it's "system" module. User can make their own overlay
|
||||
// in non-system directory.
|
||||
// Remove this block after we fix the test suite.
|
||||
if (auto shadowed = loadedModuleFile->getShadowedModule())
|
||||
if (auto shadowed = loadedModuleFile->getUnderlyingModule())
|
||||
if (shadowed->isSystemModule())
|
||||
M.setIsSystemModule(true);
|
||||
|
||||
@@ -704,8 +704,8 @@ void swift::serialization::diagnoseSerializedASTLoadFailure(
|
||||
break;
|
||||
}
|
||||
|
||||
case serialization::Status::MissingShadowedModule: {
|
||||
Ctx.Diags.diagnose(diagLoc, diag::serialization_missing_shadowed_module,
|
||||
case serialization::Status::MissingUnderlyingModule: {
|
||||
Ctx.Diags.diagnose(diagLoc, diag::serialization_missing_underlying_module,
|
||||
ModuleName);
|
||||
if (Ctx.SearchPathOpts.SDKPath.empty() &&
|
||||
llvm::Triple(llvm::sys::getProcessTriple()).isMacOSX()) {
|
||||
@@ -938,7 +938,7 @@ void SerializedASTFile::collectLinkLibraries(
|
||||
}
|
||||
|
||||
bool SerializedASTFile::isSystemModule() const {
|
||||
if (auto Mod = File.getShadowedModule()) {
|
||||
if (auto Mod = File.getUnderlyingModule()) {
|
||||
return Mod->isSystemModule();
|
||||
}
|
||||
return false;
|
||||
@@ -1065,8 +1065,8 @@ StringRef SerializedASTFile::getFilename() const {
|
||||
}
|
||||
|
||||
const clang::Module *SerializedASTFile::getUnderlyingClangModule() const {
|
||||
if (auto *ShadowedModule = File.getShadowedModule())
|
||||
return ShadowedModule->findUnderlyingClangModule();
|
||||
if (auto *UnderlyingModule = File.getUnderlyingModule())
|
||||
return UnderlyingModule->findUnderlyingClangModule();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user