mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Make -import-underlying-module automatically export that module.
That's how everything behaved anyway. Might as well make it explicit and stop special-casing it. I've left in compatibility for modules built with older compilers so that people using the OS toolchains aren't immediately unable to debug their apps. As soon as we change the module format in a more significant way, I can take this out. Groundwork for rdar://problem/21254367; see next commit. Swift SVN r29437
This commit is contained in:
@@ -1067,6 +1067,11 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
|
||||
continue;
|
||||
}
|
||||
|
||||
// This is for backwards-compatibility with modules that still rely on the
|
||||
// "HasUnderlyingModule" flag.
|
||||
if (Bits.HasUnderlyingModule && module == ShadowedModule)
|
||||
dependency.forceExported();
|
||||
|
||||
if (scopePath.empty()) {
|
||||
dependency.Import = { {}, module };
|
||||
} else {
|
||||
@@ -1082,9 +1087,6 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
|
||||
return error(Status::MissingDependency);
|
||||
}
|
||||
|
||||
if (Bits.HasUnderlyingModule)
|
||||
(void)getModule(FileContext->getParentModule()->getName());
|
||||
|
||||
if (Bits.HasEntryPoint) {
|
||||
FileContext->getParentModule()->registerEntryPointFile(FileContext,
|
||||
SourceLoc(),
|
||||
@@ -1171,8 +1173,6 @@ void ModuleFile::getImportedModules(
|
||||
SmallVectorImpl<Module::ImportedModule> &results,
|
||||
Module::ImportFilter filter) {
|
||||
PrettyModuleFileDeserialization stackEntry(*this);
|
||||
bool includeShadowedModule = (filter != Module::ImportFilter::Private &&
|
||||
ShadowedModule && Bits.HasUnderlyingModule);
|
||||
|
||||
for (auto &dep : Dependencies) {
|
||||
if (filter != Module::ImportFilter::All &&
|
||||
@@ -1180,15 +1180,7 @@ void ModuleFile::getImportedModules(
|
||||
continue;
|
||||
assert(dep.isLoaded());
|
||||
results.push_back(dep.Import);
|
||||
|
||||
// FIXME: Do we want a way to limit re-exports?
|
||||
if (includeShadowedModule && dep.Import.first.empty() &&
|
||||
dep.Import.second == ShadowedModule)
|
||||
includeShadowedModule = false;
|
||||
}
|
||||
|
||||
if (includeShadowedModule)
|
||||
results.push_back({ {}, ShadowedModule });
|
||||
}
|
||||
|
||||
void ModuleFile::getImportDecls(SmallVectorImpl<Decl *> &Results) {
|
||||
|
||||
Reference in New Issue
Block a user