[ClangImporter] Add an option (off by default) to infer "implicit properties".

In Objective-C, any method with no arguments can be used with dot syntax, as
can any method that takes one argument whose name starts with "set". This
commit adds a frontend-only flag -enable-objc-implicit-properties to look for
"setter-like" methods that match up with "getter-like" methods to import them
as Swift properties. By default, such methods are just considered unrelated
methods.

Part of <rdar://problem/16215476>

Swift SVN r16025
This commit is contained in:
Jordan Rose
2014-04-07 21:49:37 +00:00
parent 28d4b2a98c
commit 835bfb15a9
9 changed files with 240 additions and 14 deletions

View File

@@ -560,6 +560,9 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts, ArgList &Args,
Opts.ExtraArgs.push_back(A->getValue());
}
Opts.InferImplicitProperties =
Args.hasArg(OPT_enable_objc_implicit_properties);
return false;
}