Skip to content

Commit c49a992

Browse files
committed
Turn on import of ObjC generics.
1 parent 720167f commit c49a992

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ namespace swift {
156156

157157
/// Whether classes with Objective-C lightweight generic type parameters
158158
/// should be imported into Swift as generic classes.
159-
bool ImportObjCGenerics = false;
159+
bool ImportObjCGenerics = true;
160160

161161
/// Enable the Swift 3 migration via Fix-Its.
162162
bool Swift3Migration = false;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
783783
if (Args.hasArg(OPT_disable_infer_iuos)) {
784784
Opts.InferIUOs = false;
785785
}
786-
Opts.ImportObjCGenerics = Args.hasArg(OPT_enable_import_objc_generics);
786+
Opts.ImportObjCGenerics |= Args.hasArg(OPT_enable_import_objc_generics);
787787

788788
Opts.EnableThrowWithoutTry |= Args.hasArg(OPT_enable_throw_without_try);
789789

test/ClangModules/objc_bridging_generics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -sdk %S/../Inputs/clang-importer-sdk -I %S/../Inputs/clang-importer-sdk/swift-modules -enable-source-import -enable-import-objc-generics -parse -parse-as-library -verify %s
1+
// RUN: %target-swift-frontend -sdk %S/../Inputs/clang-importer-sdk -I %S/../Inputs/clang-importer-sdk/swift-modules -enable-source-import -parse -parse-as-library -verify %s
22

33
// REQUIRES: objc_interop
44

test/IRGen/objc_generic_class_convention.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -enable-import-objc-generics -emit-ir | FileCheck %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -emit-ir | FileCheck %s
22

33
// REQUIRES: objc_interop
44

test/IRGen/objc_generic_class_metadata.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -enable-import-objc-generics -emit-ir | FileCheck %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -emit-ir | FileCheck %s
22

33
// REQUIRES: objc_interop
44

test/Interpreter/imported_objc_generics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: mkdir -p %t
33
//
44
// RUN: %target-clang -fobjc-arc %S/Inputs/ObjCClasses/ObjCClasses.m -c -o %t/ObjCClasses.o
5-
// RUN: %target-build-swift -Xfrontend -enable-import-objc-generics -I %S/Inputs/ObjCClasses/ %t/ObjCClasses.o %s -o %t/a.out
5+
// RUN: %target-build-swift -I %S/Inputs/ObjCClasses/ %t/ObjCClasses.o %s -o %t/a.out
66
// RUN: %target-run %t/a.out
77

88
// REQUIRES: executable_test

test/Interpreter/imported_objc_generics_extension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: mkdir -p %t
33
//
44
// RUN: %target-clang -fobjc-arc %S/Inputs/ObjCClasses/ObjCClasses.m -c -o %t/ObjCClasses.o
5-
// RUN: %target-build-swift -Xfrontend -enable-import-objc-generics -I %S/Inputs/ObjCClasses/ %t/ObjCClasses.o %s -o %t/a.out
5+
// RUN: %target-build-swift -I %S/Inputs/ObjCClasses/ %t/ObjCClasses.o %s -o %t/a.out
66
// RUN: %target-run %t/a.out
77

88
// REQUIRES: executable_test

test/PrintAsObjC/classes.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
// RUN: mkdir %t
77

88
// FIXME: BEGIN -enable-source-import hackaround
9-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -enable-import-objc-generics -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift
10-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -enable-import-objc-generics -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/CoreGraphics.swift
11-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -enable-import-objc-generics -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift
12-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -enable-import-objc-generics -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/AppKit.swift
9+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift
10+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/CoreGraphics.swift
11+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift
12+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/AppKit.swift
1313
// FIXME: END -enable-source-import hackaround
1414

1515

16-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -enable-import-objc-generics -emit-module -o %t %s -disable-objc-attr-requires-foundation-module
17-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -enable-import-objc-generics -parse-as-library %t/classes.swiftmodule -parse -emit-objc-header-path %t/classes.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
16+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %s -disable-objc-attr-requires-foundation-module
17+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -parse-as-library %t/classes.swiftmodule -parse -emit-objc-header-path %t/classes.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
1818
// RUN: FileCheck %s < %t/classes.h
1919
// RUN: FileCheck --check-prefix=NEGATIVE %s < %t/classes.h
2020
// RUN: %check-in-clang %t/classes.h

0 commit comments

Comments
 (0)