mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user