mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SE-0160] Allow one to enable/disable Swift 3 @objc inference rules.
Introduce flags `-enable-swift3-objc-inference` and `-disable-swift3-objc-inference` to enable/disable the Swift 3 `@objc` inference rules. Under `-swift-version 3`, default to the former; under `-swift-version 4`, default to the latter. For testing purposes, one can provide either flag in eiher language mode.
This commit is contained in:
@@ -957,6 +957,11 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
Opts.EnableAppExtensionRestrictions |= Args.hasArg(OPT_enable_app_extension);
|
||||
Opts.WarnSwift3ObjCInference |= Args.hasArg(OPT_warn_swift3_objc_inference);
|
||||
|
||||
Opts.EnableSwift3ObjCInference =
|
||||
Args.hasFlag(OPT_enable_swift3_objc_inference,
|
||||
OPT_disable_swift3_objc_inference,
|
||||
Opts.isSwiftVersion3());
|
||||
|
||||
llvm::Triple Target = Opts.Target;
|
||||
StringRef TargetArg;
|
||||
if (const Arg *A = Args.getLastArg(OPT_target)) {
|
||||
|
||||
Reference in New Issue
Block a user