Skip to content

Commit 03c8ccb

Browse files
committed
Frontend: Remove unused ModuleInterfaceOptionIgnorablePrivate.
1 parent 496a004 commit 03c8ccb

File tree

5 files changed

+4
-30
lines changed

5 files changed

+4
-30
lines changed

include/swift/Frontend/ModuleInterfaceSupport.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#define SWIFT_COMPILER_VERSION_KEY "swift-compiler-version"
2222
#define SWIFT_MODULE_FLAGS_KEY "swift-module-flags"
2323
#define SWIFT_MODULE_FLAGS_IGNORABLE_KEY "swift-module-flags-ignorable"
24-
#define SWIFT_MODULE_FLAGS_IGNORABLE_PRIVATE_KEY "swift-module-flags-ignorable-private"
2524

2625
namespace swift {
2726

@@ -56,10 +55,6 @@ struct ModuleInterfaceOptions {
5655
/// ignored by the earlier version of the compiler.
5756
std::string IgnorableFlags;
5857

59-
/// Ignorable flags that should only be printed in .private.swiftinterface file;
60-
/// e.g. -package-name PACKAGE_ID
61-
std::string IgnorablePrivateFlags;
62-
6358
/// Print imports with both @_implementationOnly and @_spi, only applies
6459
/// when PrintSPIs is true.
6560
bool ExperimentalSPIImports = false;

include/swift/Option/Options.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ namespace options {
4242
SwiftAPIDigesterOption = (1 << 17),
4343
NewDriverOnlyOption = (1 << 18),
4444
ModuleInterfaceOptionIgnorable = (1 << 19),
45-
ModuleInterfaceOptionIgnorablePrivate = (1 << 20),
46-
ArgumentIsFileList = (1 << 21),
47-
CacheInvariant = (1 << 22),
45+
ArgumentIsFileList = (1 << 20),
46+
CacheInvariant = (1 << 21),
4847
};
4948

5049
enum ID {

include/swift/Option/Options.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ def ModuleInterfaceOption : OptionFlag;
5656
// The option can be safely ignored by the older compiler.
5757
def ModuleInterfaceOptionIgnorable : OptionFlag;
5858

59-
// The option should be written into a .private.swiftinterface or
60-
// .package.swiftinterface module interface file, and read/parsed from
61-
// there when reconstituting a .swiftmodule from it.
62-
// The option can be safely ignored by the older compiler.
63-
def ModuleInterfaceOptionIgnorablePrivate : OptionFlag;
64-
6559
// The option causes the output of a supplementary output, or is the path option
6660
// for a supplementary output. E.g., `-emit-module` and `-emit-module-path`.
6761
def SupplementaryOutput : OptionFlag;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -459,18 +459,16 @@ static void SaveModuleInterfaceArgs(ModuleInterfaceOptions &Opts,
459459
ArgList &Args, DiagnosticEngine &Diags) {
460460
if (!FOpts.InputsAndOutputs.hasModuleInterfaceOutputPath())
461461
return;
462+
462463
ArgStringList RenderedArgs;
463464
ArgStringList RenderedArgsForPackageOnly;
464465
ArgStringList RenderedArgsIgnorable;
465-
ArgStringList RenderedArgsIgnorablePrivate;
466466

467467
for (auto A : Args) {
468468
if (!ShouldIncludeModuleInterfaceArg(A))
469469
continue;
470470

471-
if (A->getOption().hasFlag(options::ModuleInterfaceOptionIgnorablePrivate)) {
472-
A->render(Args, RenderedArgsIgnorablePrivate);
473-
} else if (A->getOption().hasFlag(options::ModuleInterfaceOptionIgnorable)) {
471+
if (A->getOption().hasFlag(options::ModuleInterfaceOptionIgnorable)) {
474472
A->render(Args, RenderedArgsIgnorable);
475473
} else if (A->getOption().hasFlag(options::ModuleInterfaceOption)) {
476474
if (ShouldIncludeArgInPackageInterfaceOnly(A, Args))
@@ -492,12 +490,6 @@ static void SaveModuleInterfaceArgs(ModuleInterfaceOptions &Opts,
492490
[&](const char *Argument) { PrintArg(OS, Argument, StringRef()); },
493491
[&] { OS << " "; });
494492
}
495-
{
496-
llvm::raw_string_ostream OS(Opts.IgnorablePrivateFlags);
497-
interleave(RenderedArgsIgnorablePrivate,
498-
[&](const char *Argument) { PrintArg(OS, Argument, StringRef()); },
499-
[&] { OS << " "; });
500-
}
501493
{
502494
llvm::raw_string_ostream OS(Opts.IgnorableFlags);
503495
interleave(RenderedArgsIgnorable,

lib/Frontend/ModuleInterfaceSupport.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ static void printToolVersionAndFlagsComment(raw_ostream &out,
107107
out << "// " SWIFT_MODULE_FLAGS_IGNORABLE_KEY ": "
108108
<< Opts.IgnorableFlags << "\n";
109109
}
110-
111-
auto hasPrivateIgnorableFlags = !Opts.printPublicInterface() && !Opts.IgnorablePrivateFlags.empty();
112-
if (hasPrivateIgnorableFlags) {
113-
out << "// " SWIFT_MODULE_FLAGS_IGNORABLE_PRIVATE_KEY ": "
114-
<< Opts.IgnorablePrivateFlags << "\n";
115-
}
116110
}
117111

118112
std::string

0 commit comments

Comments
 (0)