Skip to content

Commit 010973c

Browse files
committed
[Frontend|NFC] Rename ModuleInterfaceOptions::PrintPrivateInterfaceContent
1 parent 62b26b1 commit 010973c

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

include/swift/Frontend/ModuleInterfaceSupport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ struct ModuleInterfaceOptions {
5050
/// ignored by the earlier version of the compiler.
5151
std::string IgnorableFlags;
5252

53-
/// Print SPI decls and attributes.
54-
bool PrintSPIs = false;
53+
/// Print for a private swiftinterface file, SPI decls and attributes.
54+
bool PrintPrivateInterfaceContent = false;
5555

5656
/// Print imports with both @_implementationOnly and @_spi, only applies
5757
/// when PrintSPIs is true.

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ static void ParseModuleInterfaceArgs(ModuleInterfaceOptions &Opts,
384384
if (const Arg *A = Args.getLastArg(OPT_library_level)) {
385385
StringRef contents = A->getValue();
386386
if (contents == "spi") {
387-
Opts.PrintSPIs = true;
387+
Opts.PrintPrivateInterfaceContent = true;
388388
}
389389
}
390390
for (auto val: Args.getAllArgValues(OPT_skip_import_in_public_interface)) {

lib/Frontend/ModuleInterfaceSupport.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static void printImports(raw_ostream &out,
225225
// imports only if they are also SPI. First, list all implementation-only
226226
// imports and filter them later.
227227
llvm::SmallSet<ImportedModule, 4, ImportedModule::Order> ioiImportSet;
228-
if (Opts.PrintSPIs && Opts.ExperimentalSPIImports) {
228+
if (Opts.PrintPrivateInterfaceContent && Opts.ExperimentalSPIImports) {
229229

230230
SmallVector<ImportedModule, 4> ioiImports, allImports;
231231
M->getImportedModules(ioiImports,
@@ -246,7 +246,7 @@ static void printImports(raw_ostream &out,
246246

247247
/// Collect @_spiOnly imports that are not imported elsewhere publicly.
248248
llvm::SmallSet<ImportedModule, 4, ImportedModule::Order> spiOnlyImportSet;
249-
if (Opts.PrintSPIs) {
249+
if (Opts.PrintPrivateInterfaceContent) {
250250
SmallVector<ImportedModule, 4> spiOnlyImports, otherImports;
251251
M->getImportedModules(spiOnlyImports,
252252
ModuleDecl::ImportFilterKind::SPIOnly);
@@ -305,7 +305,7 @@ static void printImports(raw_ostream &out,
305305
if (publicImportSet.count(import))
306306
out << "@_exported ";
307307

308-
if (Opts.PrintSPIs) {
308+
if (Opts.PrintPrivateInterfaceContent) {
309309
// An import visible in the private swiftinterface only.
310310
//
311311
// In the long term, we want to print this attribute for consistency and
@@ -789,7 +789,8 @@ bool swift::emitSwiftInterface(raw_ostream &out,
789789
printImports(out, Opts, M);
790790

791791
const PrintOptions printOptions = PrintOptions::printSwiftInterfaceFile(
792-
M, Opts.PreserveTypesAsWritten, Opts.PrintFullConvention, Opts.PrintSPIs,
792+
M, Opts.PreserveTypesAsWritten, Opts.PrintFullConvention,
793+
Opts.PrintPrivateInterfaceContent,
793794
Opts.AliasModuleNames, &aliasModuleNamesTargets);
794795
InheritedProtocolCollector::PerTypeMap inheritedProtocolMap;
795796

lib/FrontendTool/FrontendTool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ static bool emitAnyWholeModulePostTypeCheckSupplementaryOutputs(
949949
if (opts.InputsAndOutputs.hasPrivateModuleInterfaceOutputPath()) {
950950
// Copy the settings from the module interface to add SPI printing.
951951
ModuleInterfaceOptions privOpts = Invocation.getModuleInterfaceOptions();
952-
privOpts.PrintSPIs = true;
952+
privOpts.PrintPrivateInterfaceContent = true;
953953
privOpts.ModulesToSkipInPublicInterface.clear();
954954

955955
hadAnyError |= printModuleInterfaceIfNeeded(

0 commit comments

Comments
 (0)