mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Dependency Scanning] Keep track of whether a given Swift 'import' statement is '@_exported'
This commit is contained in:
@@ -412,6 +412,7 @@ ModuleDependencyScanner::getMainModuleDependencyInfo(ModuleDecl *mainModule) {
|
||||
// Add any implicit module names.
|
||||
for (const auto &import : importInfo.AdditionalUnloadedImports) {
|
||||
mainDependencies.addModuleImport(import.module.getModulePath(),
|
||||
import.options.contains(ImportFlags::Exported),
|
||||
&alreadyAddedModules,
|
||||
&ScanASTContext.SourceMgr);
|
||||
}
|
||||
@@ -420,6 +421,7 @@ ModuleDependencyScanner::getMainModuleDependencyInfo(ModuleDecl *mainModule) {
|
||||
for (const auto &import : importInfo.AdditionalImports) {
|
||||
mainDependencies.addModuleImport(
|
||||
import.module.importedModule->getNameStr(),
|
||||
import.options.contains(ImportFlags::Exported),
|
||||
&alreadyAddedModules);
|
||||
}
|
||||
|
||||
@@ -432,6 +434,7 @@ ModuleDependencyScanner::getMainModuleDependencyInfo(ModuleDecl *mainModule) {
|
||||
// add a dependency with the same name to trigger the search.
|
||||
if (importInfo.ShouldImportUnderlyingModule) {
|
||||
mainDependencies.addModuleImport(mainModule->getName().str(),
|
||||
/* isExported */ true,
|
||||
&alreadyAddedModules);
|
||||
}
|
||||
|
||||
@@ -441,6 +444,7 @@ ModuleDependencyScanner::getMainModuleDependencyInfo(ModuleDecl *mainModule) {
|
||||
for (const auto &tbdSymbolModule :
|
||||
ScanCompilerInvocation.getTBDGenOptions().embedSymbolsFromModules) {
|
||||
mainDependencies.addModuleImport(tbdSymbolModule,
|
||||
/* isExported */ false,
|
||||
&alreadyAddedModules);
|
||||
}
|
||||
}
|
||||
@@ -1354,7 +1358,8 @@ void ModuleDependencyScanner::resolveCrossImportOverlayDependencies(
|
||||
ModuleDependencyInfo::forSwiftSourceModule();
|
||||
std::for_each(newOverlays.begin(), newOverlays.end(),
|
||||
[&](Identifier modName) {
|
||||
dummyMainDependencies.addModuleImport(modName.str());
|
||||
dummyMainDependencies.addModuleImport(modName.str(),
|
||||
/* isExported */ false);
|
||||
});
|
||||
|
||||
// Record the dummy main module's direct dependencies. The dummy main module
|
||||
|
||||
Reference in New Issue
Block a user