[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:
Doug Gregor
2017-03-27 21:59:42 -07:00
parent 6d1bc9cf03
commit ebdfb40ebb
8 changed files with 58 additions and 5 deletions

View File

@@ -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)) {