Frontend: Hide and deprecate options for Swift 3 @objc inference.

The compiler has not supported migrating Swift 3 code to Swift 4 for a long
time. The `-enable-swift3-objc-inference` option and related options were
originally designed to aid that transition and should be deprecated at this
point.

Resolves rdar://120490061
This commit is contained in:
Allan Shortlidge
2024-01-08 12:25:58 -08:00
parent d61eac29d8
commit 2fbef52d16
3 changed files with 22 additions and 6 deletions

View File

@@ -920,6 +920,14 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Args.hasFlag(OPT_enable_swift3_objc_inference,
OPT_disable_swift3_objc_inference, false);
if (Args.hasArg(OPT_enable_swift3_objc_inference))
Diags.diagnose(SourceLoc(), diag::warn_flag_deprecated,
"-enable-swift3-objc-inference");
if (Args.hasArg(OPT_disable_swift3_objc_inference))
Diags.diagnose(SourceLoc(), diag::warn_flag_deprecated,
"-disable-swift3-objc-inference");
if (const Arg *A = Args.getLastArg(OPT_library_level)) {
StringRef contents = A->getValue();
if (contents == "api") {
@@ -983,6 +991,14 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
}
}
if (Args.hasArg(OPT_warn_swift3_objc_inference_minimal))
Diags.diagnose(SourceLoc(), diag::warn_flag_deprecated,
"-warn-swift3-objc-inference-minimal");
if (Args.hasArg(OPT_warn_swift3_objc_inference_complete))
Diags.diagnose(SourceLoc(), diag::warn_flag_deprecated,
"-warn-swift3-objc-inference-complete");
// Swift 6+ uses the strictest concurrency level.
if (Opts.isSwiftVersionAtLeast(6)) {
Opts.StrictConcurrencyLevel = StrictConcurrency::Complete;