Skip to content

Commit a28b729

Browse files
committed
Frontend: Remove unused ModuleInterfaceOptionIgnorablePrivate.
1 parent 1fde4c1 commit a28b729

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
@@ -41,9 +41,8 @@ namespace options {
4141
SwiftAPIDigesterOption = (1 << 16),
4242
NewDriverOnlyOption = (1 << 17),
4343
ModuleInterfaceOptionIgnorable = (1 << 18),
44-
ModuleInterfaceOptionIgnorablePrivate = (1 << 19),
45-
ArgumentIsFileList = (1 << 20),
46-
CacheInvariant = (1 << 21),
44+
ArgumentIsFileList = (1 << 19),
45+
CacheInvariant = (1 << 20),
4746
};
4847

4948
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
@@ -499,18 +499,16 @@ static void SaveModuleInterfaceArgs(ModuleInterfaceOptions &Opts,
499499
ArgList &Args, DiagnosticEngine &Diags) {
500500
if (!FOpts.InputsAndOutputs.hasModuleInterfaceOutputPath())
501501
return;
502+
502503
ArgStringList RenderedArgs;
503504
ArgStringList RenderedArgsForPackageOnly;
504505
ArgStringList RenderedArgsIgnorable;
505-
ArgStringList RenderedArgsIgnorablePrivate;
506506

507507
for (auto A : Args) {
508508
if (!ShouldIncludeModuleInterfaceArg(A))
509509
continue;
510510

511-
if (A->getOption().hasFlag(options::ModuleInterfaceOptionIgnorablePrivate)) {
512-
A->render(Args, RenderedArgsIgnorablePrivate);
513-
} else if (A->getOption().hasFlag(options::ModuleInterfaceOptionIgnorable)) {
511+
if (A->getOption().hasFlag(options::ModuleInterfaceOptionIgnorable)) {
514512
A->render(Args, RenderedArgsIgnorable);
515513
} else if (A->getOption().hasFlag(options::ModuleInterfaceOption)) {
516514
if (ShouldIncludeArgInPackageInterfaceOnly(A, Args))
@@ -532,12 +530,6 @@ static void SaveModuleInterfaceArgs(ModuleInterfaceOptions &Opts,
532530
[&](const char *Argument) { PrintArg(OS, Argument, StringRef()); },
533531
[&] { OS << " "; });
534532
}
535-
{
536-
llvm::raw_string_ostream OS(Opts.IgnorablePrivateFlags);
537-
interleave(RenderedArgsIgnorablePrivate,
538-
[&](const char *Argument) { PrintArg(OS, Argument, StringRef()); },
539-
[&] { OS << " "; });
540-
}
541533
{
542534
llvm::raw_string_ostream OS(Opts.IgnorableFlags);
543535
interleave(RenderedArgsIgnorable,

lib/Frontend/ModuleInterfaceSupport.cpp

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

119113
std::string

0 commit comments

Comments
 (0)