Skip to content

Frontend: Remove the -skip-import-in-public-interface flag #79254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions include/swift/Frontend/ModuleInterfaceSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ struct ModuleInterfaceOptions {
/// Intentionally print invalid syntax into the file.
bool DebugPrintInvalidSyntax = false;

/// A list of modules we shouldn't import in the public interfaces.
std::vector<std::string> ModulesToSkipInPublicInterface;

/// A mode which decides whether the printed interface contains package, SPIs, or public/inlinable declarations.
PrintOptions::InterfaceMode InterfaceContentMode = PrintOptions::InterfaceMode::Public;
bool printPublicInterface() const {
Expand Down
5 changes: 0 additions & 5 deletions include/swift/Option/FrontendOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -1239,11 +1239,6 @@ def new_driver_path
: Separate<["-"], "new-driver-path">, MetaVarName<"<path>">,
HelpText<"Path of the new driver to be used">;

def skip_import_in_public_interface:
Separate<["-"], "skip-import-in-public-interface">,
HelpText<"Skip the import statement corresponding to a module name "
"when printing the public interface.">;

def disable_fine_module_tracing:
Flag<["-"], "disable-fine-module-tracing">,
HelpText<"Skip the emission of fine grained module tracing file.">;
Expand Down
3 changes: 0 additions & 3 deletions lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,6 @@ static void ParseModuleInterfaceArgs(ModuleInterfaceOptions &Opts,
Opts.setInterfaceMode(PrintOptions::InterfaceMode::Private);
}
}
for (auto val: Args.getAllArgValues(OPT_skip_import_in_public_interface)) {
Opts.ModulesToSkipInPublicInterface.push_back(val);
}
}

/// Checks if an arg is generally allowed to be included
Expand Down
5 changes: 0 additions & 5 deletions lib/Frontend/ModuleInterfaceSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,6 @@ static void printImports(raw_ostream &out,
continue;
}

if (llvm::count(Opts.ModulesToSkipInPublicInterface,
importedModule->getName().str())) {
continue;
}

llvm::SmallSetVector<Identifier, 4> spis;
M->lookupImportedSPIGroups(importedModule, spis);

Expand Down
2 changes: 0 additions & 2 deletions lib/FrontendTool/FrontendTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,6 @@ static bool emitAnyWholeModulePostTypeCheckSupplementaryOutputs(
// Copy the settings from the module interface to add SPI printing.
ModuleInterfaceOptions privOpts = Invocation.getModuleInterfaceOptions();
privOpts.setInterfaceMode(PrintOptions::InterfaceMode::Private);
privOpts.ModulesToSkipInPublicInterface.clear();

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

hadAnyError |= printModuleInterfaceIfNeeded(
Instance.getOutputBackend(),
Expand Down
25 changes: 0 additions & 25 deletions test/ModuleInterface/skip-import-in-public-interface.swift

This file was deleted.