[Sema] Allow the use of SPI in API for SPI modules

When the whole module has an SPI distribution, SPI declarations can be
used in API.

rdar://75335462
This commit is contained in:
Alexis Laferrière
2021-03-24 15:55:39 -07:00
parent 091e5affe8
commit 758351110a
6 changed files with 48 additions and 5 deletions

View File

@@ -331,6 +331,13 @@ static void ParseModuleInterfaceArgs(ModuleInterfaceOptions &Opts,
Args.hasArg(OPT_experimental_spi_imports);
Opts.DebugPrintInvalidSyntax |=
Args.hasArg(OPT_debug_emit_invalid_swiftinterface_syntax);
if (const Arg *A = Args.getLastArg(OPT_library_level)) {
StringRef contents = A->getValue();
if (contents == "spi") {
Opts.PrintSPIs = true;
}
}
}
/// Save a copy of any flags marked as ModuleInterfaceOption, if running