Frontend: Remove support for -experimental-spi-imports flag.

Its functionality has been superseded by `@_spiOnly import`. There are no
longer any known clients and the flag was already unsupported in Swift 6, so
the functionality is now removed (but the flag is only deprecated for Swift 5).

Resolves rdar://136867210.
This commit is contained in:
Allan Shortlidge
2024-09-30 23:35:08 -07:00
parent 88ac67d377
commit 9e93b7b730
6 changed files with 20 additions and 128 deletions

View File

@@ -279,27 +279,6 @@ static void printImports(raw_ostream &out,
return importSet;
};
// With -experimental-spi-imports:
// When printing the private or package swiftinterface file, print implementation-only
// imports only if they are also SPI. First, list all implementation-only imports and
// filter them later.
llvm::SmallSet<ImportedModule, 4, ImportedModule::Order> ioiImportSet;
if (!Opts.printPublicInterface() && Opts.ExperimentalSPIImports) {
SmallVector<ImportedModule, 4> ioiImports, allImports;
M->getImportedModules(ioiImports,
ModuleDecl::ImportFilterKind::ImplementationOnly);
// Only consider modules imported consistently as implementation-only.
ImportSet allImportSet = getImports(allImportFilter);
for (auto import: ioiImports)
if (allImportSet.count(import) == 0)
ioiImportSet.insert(import);
allImportFilter |= ModuleDecl::ImportFilterKind::ImplementationOnly;
}
/// Collect @_spiOnly imports that are not imported elsewhere publicly.
ImportSet spiOnlyImportSet;
if (!Opts.printPublicInterface()) {
@@ -367,13 +346,6 @@ static void printImports(raw_ostream &out,
llvm::SmallSetVector<Identifier, 4> spis;
M->lookupImportedSPIGroups(importedModule, spis);
// Only print implementation-only imports which have an SPI import.
if (ioiImportSet.count(import)) {
if (spis.empty())
continue;
out << "@_implementationOnly ";
}
if (exportedImportSet.count(import))
out << "@_exported ";