mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
rework cross-module-optimization
* rename the CrossModuleSerializationSetup pass to simply CrossModuleOptimization * remove the CMO specific serializer pass. Instead run the CrossModuleSerializationSetup pass directly before the standard serializer pass. * correctly handle shared functions (e.g. specializations) * refactoring
This commit is contained in:
@@ -2374,17 +2374,18 @@ canBeUsedForCrossModuleOptimization(DeclContext *ctxt) const {
|
||||
// See if context is imported in a "regular" way, i.e. not with
|
||||
// @_implementationOnly or @_spi.
|
||||
ModuleDecl::ImportFilter filter = {
|
||||
ModuleDecl::ImportFilterKind::Exported,
|
||||
ModuleDecl::ImportFilterKind::Default};
|
||||
ModuleDecl::ImportFilterKind::ImplementationOnly,
|
||||
ModuleDecl::ImportFilterKind::SPIAccessControl
|
||||
};
|
||||
SmallVector<ImportedModule, 4> results;
|
||||
getImportedModules(results, filter);
|
||||
|
||||
auto &imports = getASTContext().getImportCache();
|
||||
for (auto &desc : results) {
|
||||
if (imports.isImportedBy(moduleOfCtxt, desc.importedModule))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void SourceFile::lookupImportedSPIGroups(
|
||||
|
||||
Reference in New Issue
Block a user