Remove Swift 3 @objc behavior

This commit is contained in:
Slava Pestov
2018-10-30 16:03:09 -04:00
parent 026895673b
commit 38ccddd24f
2 changed files with 5 additions and 10 deletions

View File

@@ -364,8 +364,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.EnableSwift3ObjCInference =
Args.hasFlag(OPT_enable_swift3_objc_inference,
OPT_disable_swift3_objc_inference,
Opts.isSwiftVersion3());
OPT_disable_swift3_objc_inference, false);
if (Opts.EnableSwift3ObjCInference) {
if (const Arg *A = Args.getLastArg(

View File

@@ -1425,14 +1425,10 @@ void SILGenFunction::emitNativeToForeignThunk(SILDeclRef thunk) {
}
if (auto attr = decl->getAttrs().getAttribute<ObjCAttr>()) {
// If @objc was inferred based on the Swift 3 @objc inference rules, but
// we aren't compiling in Swift 3 compatibility mode, emit a call to
// Builtin.swift3ImplicitObjCEntrypoint() to enable runtime logging of
// the uses of such entrypoints.
if (attr->isSwift3Inferred() &&
!decl->isDynamic() &&
!getASTContext().LangOpts.isSwiftVersion3()) {
// If @objc was inferred based on the Swift 3 @objc inference rules, emit
// a call to Builtin.swift3ImplicitObjCEntrypoint() to enable runtime
// logging of the uses of such entrypoints.
if (attr->isSwift3Inferred() && !decl->isDynamic()) {
// Get the starting source location of the declaration so we can say
// exactly where to stick '@objc'.
SourceLoc objcInsertionLoc =