[Migrator] Conservative and Minimal @objc inference workflows

Based on recommendations in SE-0160, there are two migration workflows:

- Conservative: Maintain @objc visibility that was inferred in Swift 3
  by adding @objc to all declarations that were implicitily visible to
  the Objective-C runtime. This is invoked in the migrator by adding the
  -migrate-keep-objc-visibility flag.
- Minimal: Only declarations that must be visible to Objective-C based
  on their uses (or in cases like dynamic vars) are migrated.

rdar://problem/31876357
This commit is contained in:
David Farler
2017-04-28 18:28:34 -07:00
parent cd48479d14
commit bf52ff032a
23 changed files with 105 additions and 53 deletions

View File

@@ -1578,7 +1578,7 @@ bool ParseMigratorArgs(MigratorOptions &Opts, llvm::Triple &Triple,
DiagnosticEngine &Diags) {
using namespace options;
Opts.AddObjC |= Args.hasArg(OPT_warn_swift3_objc_inference);
Opts.KeepObjcVisibility |= Args.hasArg(OPT_migrate_keep_objc_visibility);
Opts.DumpUsr = Args.hasArg(OPT_dump_usr);
if (Args.hasArg(OPT_disable_migrator_fixits)) {