Skip to content

Commit 1f7b0c7

Browse files
authored
Merge pull request #42114 from nkcsgexi/disable-clang-spi-flag
Frontend: flip the default of whether importing SPI_AVAILABLE from clang
2 parents dd7610f + 91c4f17 commit 1f7b0c7

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ namespace swift {
828828
bool DisableOverlayModules = false;
829829

830830
/// When set, import SPI_AVAILABLE symbols with Swift SPI attribtues.
831-
bool EnableClangSPI = false;
831+
bool EnableClangSPI = true;
832832

833833
/// When set, don't enforce warnings with -Werror.
834834
bool DebuggerSupport = false;

include/swift/Option/FrontendOptions.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ def disable_testable_attr_requires_testable_module :
142142
Flag<["-"], "disable-testable-attr-requires-testable-module">,
143143
HelpText<"Disable checking of @testable">;
144144

145-
def enable_clang_spi :
146-
Flag<["-"], "enable-clang-spi">,
147-
HelpText<"Import Clang SPIs as Swift SPIs">;
145+
def disable_clang_spi :
146+
Flag<["-"], "disable-clang-spi">,
147+
HelpText<"Don't import Clang SPIs as Swift SPIs">;
148148

149149
def enable_target_os_checking :
150150
Flag<["-"], "enable-target-os-checking">,

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9069,7 +9069,7 @@ void ClangImporter::Implementation::importAttributes(
90699069
obsoleted,
90709070
/*ObsoletedRange=*/SourceRange(),
90719071
PlatformAgnostic, /*Implicit=*/false,
9072-
IsSPI);
9072+
EnableClangSPI && IsSPI);
90739073

90749074
MappedDecl->getAttrs().add(AvAttr);
90759075
}

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts,
11941194

11951195
Opts.DisableOverlayModules |= Args.hasArg(OPT_emit_imported_modules);
11961196

1197-
Opts.EnableClangSPI |= Args.hasArg(OPT_enable_clang_spi);
1197+
Opts.EnableClangSPI = !Args.hasArg(OPT_disable_clang_spi);
11981198

11991199
Opts.ExtraArgsOnly |= Args.hasArg(OPT_extra_clang_options_only);
12001200

0 commit comments

Comments
 (0)