Skip to content

Commit d00e102

Browse files
committed
Frontend: Remove the -skip-import-in-public-interface flag.
This flag is unsafe since the compiler does not verify that the resulting public interface will compile with the module import removed. The modern alternative to this flag is `@_spiOnly import`. Since the flag is no longer used by any projects it should be removed. Resolves rdar://134351088.
1 parent 0225964 commit d00e102

File tree

6 files changed

+0
-43
lines changed

6 files changed

+0
-43
lines changed

include/swift/Frontend/ModuleInterfaceSupport.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ struct ModuleInterfaceOptions {
7171
/// Intentionally print invalid syntax into the file.
7272
bool DebugPrintInvalidSyntax = false;
7373

74-
/// A list of modules we shouldn't import in the public interfaces.
75-
std::vector<std::string> ModulesToSkipInPublicInterface;
76-
7774
/// A mode which decides whether the printed interface contains package, SPIs, or public/inlinable declarations.
7875
PrintOptions::InterfaceMode InterfaceContentMode = PrintOptions::InterfaceMode::Public;
7976
bool printPublicInterface() const {

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,11 +1239,6 @@ def new_driver_path
12391239
: Separate<["-"], "new-driver-path">, MetaVarName<"<path>">,
12401240
HelpText<"Path of the new driver to be used">;
12411241

1242-
def skip_import_in_public_interface:
1243-
Separate<["-"], "skip-import-in-public-interface">,
1244-
HelpText<"Skip the import statement corresponding to a module name "
1245-
"when printing the public interface.">;
1246-
12471242
def disable_fine_module_tracing:
12481243
Flag<["-"], "disable-fine-module-tracing">,
12491244
HelpText<"Skip the emission of fine grained module tracing file.">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,6 @@ static void ParseModuleInterfaceArgs(ModuleInterfaceOptions &Opts,
525525
Opts.setInterfaceMode(PrintOptions::InterfaceMode::Private);
526526
}
527527
}
528-
for (auto val: Args.getAllArgValues(OPT_skip_import_in_public_interface)) {
529-
Opts.ModulesToSkipInPublicInterface.push_back(val);
530-
}
531528
}
532529

533530
/// Checks if an arg is generally allowed to be included

lib/Frontend/ModuleInterfaceSupport.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,6 @@ static void printImports(raw_ostream &out,
339339
continue;
340340
}
341341

342-
if (llvm::count(Opts.ModulesToSkipInPublicInterface,
343-
importedModule->getName().str())) {
344-
continue;
345-
}
346-
347342
llvm::SmallSetVector<Identifier, 4> spis;
348343
M->lookupImportedSPIGroups(importedModule, spis);
349344

lib/FrontendTool/FrontendTool.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,6 @@ static bool emitAnyWholeModulePostTypeCheckSupplementaryOutputs(
871871
// Copy the settings from the module interface to add SPI printing.
872872
ModuleInterfaceOptions privOpts = Invocation.getModuleInterfaceOptions();
873873
privOpts.setInterfaceMode(PrintOptions::InterfaceMode::Private);
874-
privOpts.ModulesToSkipInPublicInterface.clear();
875874

876875
hadAnyError |= printModuleInterfaceIfNeeded(
877876
Instance.getOutputBackend(),
@@ -884,7 +883,6 @@ static bool emitAnyWholeModulePostTypeCheckSupplementaryOutputs(
884883
// Copy the settings from the module interface to add package decl printing.
885884
ModuleInterfaceOptions pkgOpts = Invocation.getModuleInterfaceOptions();
886885
pkgOpts.setInterfaceMode(PrintOptions::InterfaceMode::Package);
887-
pkgOpts.ModulesToSkipInPublicInterface.clear();
888886

889887
hadAnyError |= printModuleInterfaceIfNeeded(
890888
Instance.getOutputBackend(),

test/ModuleInterface/skip-import-in-public-interface.swift

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)