Skip to content

Commit e3b68e7

Browse files
committed
Remove -enable-experimental-subclass-existentials staging flag
1 parent 1bce1be commit e3b68e7

21 files changed

+21
-38
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ namespace swift {
165165
/// optimized custom allocator, so that memory debugging tools can be used.
166166
bool UseMalloc = false;
167167

168-
/// \brief Enable classes to appear in protocol composition types.
169-
bool EnableExperimentalSubclassExistentials = false;
170-
171168
/// \brief Enable experimental property behavior feature.
172169
bool EnableExperimentalPropertyBehaviors = false;
173170

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,6 @@ def enable_experimental_deserialization_recovery :
274274
Flag<["-"], "enable-experimental-deserialization-recovery">,
275275
HelpText<"Attempt to recover from missing xrefs (etc) in swiftmodules">;
276276

277-
def enable_experimental_subclass_existentials : Flag<["-"],
278-
"enable-experimental-subclass-existentials">,
279-
HelpText<"Enable classes to appear in protocol composition types">;
280-
281277
def enable_cow_existentials : Flag<["-"], "enable-cow-existentials">,
282278
HelpText<"Enable the copy-on-write existential implementation">;
283279

lib/ClangImporter/ImportType.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -883,10 +883,8 @@ namespace {
883883
} else {
884884
SmallVector<Type, 4> memberTypes;
885885

886-
if (Impl.SwiftContext.LangOpts.EnableExperimentalSubclassExistentials) {
887-
if (auto superclassType = typeParam->getSuperclass())
888-
memberTypes.push_back(superclassType);
889-
}
886+
if (auto superclassType = typeParam->getSuperclass())
887+
memberTypes.push_back(superclassType);
890888

891889
for (auto protocolDecl : typeParam->getConformingProtocols())
892890
memberTypes.push_back(protocolDecl->getDeclaredType());
@@ -1029,9 +1027,7 @@ namespace {
10291027
// Swift 3 compatibility -- don't import subclass existentials
10301028
if (!type->qual_empty() &&
10311029
(importedType->isAnyObject() ||
1032-
(!Impl.SwiftContext.isSwiftVersion3() &&
1033-
Impl.SwiftContext.LangOpts.EnableExperimentalSubclassExistentials))) {
1034-
1030+
!Impl.SwiftContext.isSwiftVersion3())) {
10351031
SmallVector<Type, 4> members;
10361032
if (!importedType->isAnyObject())
10371033
members.push_back(importedType);

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -910,9 +910,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
910910
Opts.EnableExperimentalKeyPaths |=
911911
Args.hasArg(OPT_enable_experimental_keypaths);
912912

913-
Opts.EnableExperimentalSubclassExistentials |=
914-
Args.hasArg(OPT_enable_experimental_subclass_existentials);
915-
916913
Opts.EnableClassResilience |=
917914
Args.hasArg(OPT_enable_class_resilience);
918915

lib/Sema/TypeCheckType.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3100,8 +3100,7 @@ Type TypeResolver::resolveCompositionType(CompositionTypeRepr *repr,
31003100
if (!ty || ty->hasError()) return ty;
31013101

31023102
auto nominalDecl = ty->getAnyNominal();
3103-
if (TC.Context.LangOpts.EnableExperimentalSubclassExistentials &&
3104-
nominalDecl && isa<ClassDecl>(nominalDecl)) {
3103+
if (nominalDecl && isa<ClassDecl>(nominalDecl)) {
31053104
if (checkSuperclass(tyR->getStartLoc(), ty))
31063105
continue;
31073106

test/ClangImporter/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(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -verify -enable-experimental-subclass-existentials -swift-version 4 %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -verify -swift-version 4 %s
22

33
// REQUIRES: objc_interop
44

test/ClangImporter/objc_bridging_generics_swift3.swift

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) -typecheck -parse-as-library -verify -enable-experimental-subclass-existentials -swift-version 3 %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -verify -swift-version 3 %s
22

33
// REQUIRES: objc_interop
44

test/ClangImporter/subclass_existentials.swift

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) -typecheck -verify -o - -primary-file %s -swift-version 4 -enable-experimental-subclass-existentials
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify -o - -primary-file %s -swift-version 4
22

33
// REQUIRES: objc_interop
44

test/ClangImporter/subclass_existentials_ir.swift

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) -emit-ir -o - -primary-file %s -swift-version 4 -enable-experimental-subclass-existentials
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-ir -o - -primary-file %s -swift-version 4
22

33
// REQUIRES: objc_interop
44

test/ClangImporter/subclass_existentials_swift3.swift

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) -typecheck -verify -o - -primary-file %s -enable-experimental-subclass-existentials -swift-version 3
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify -o - -primary-file %s -swift-version 3
22

33
// REQUIRES: objc_interop
44

test/IRGen/objc_type_encoding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: rm -rf %t && mkdir -p %t
22
// RUN: %build-irgen-test-overlays
3-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) %s -emit-ir -disable-objc-attr-requires-foundation-module -enable-experimental-subclass-existentials | %FileCheck %s -check-prefix=CHECK-%target-os
3+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) %s -emit-ir -disable-objc-attr-requires-foundation-module | %FileCheck %s -check-prefix=CHECK-%target-os
44

55
// REQUIRES: CPU=x86_64
66
// REQUIRES: objc_interop

test/IRGen/subclass_existentials.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -primary-file %s -emit-ir -enable-experimental-subclass-existentials | %FileCheck %s --check-prefix=CHECK-%target-runtime --check-prefix=CHECK
1+
// RUN: %target-swift-frontend -primary-file %s -emit-ir | %FileCheck %s --check-prefix=CHECK-%target-runtime --check-prefix=CHECK
22

33
sil_stage canonical
44

test/IRGen/type_layout_reference_storage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-ir -enable-experimental-subclass-existentials %s | %FileCheck %s --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK
1+
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-ir %s | %FileCheck %s --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK
22

33
class C {}
44
protocol P: class {}

test/IRGen/type_layout_reference_storage_objc.swift

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) -emit-ir %s -enable-experimental-subclass-existentials | %FileCheck %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-ir %s | %FileCheck %s
22
// REQUIRES: objc_interop
33

44
import Foundation

test/Interpreter/subclass_existentials.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
// RUN: rm -rf %t
1414
// RUN: mkdir -p %t
15-
// RUN: %target-build-swift %s -o %t/a.out -Xfrontend -enable-experimental-subclass-existentials
15+
// RUN: %target-build-swift %s -o %t/a.out
1616
// RUN: %target-run %t/a.out
1717
// REQUIRES: executable_test
1818
//

test/Interpreter/subclass_existentials_objc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
// RUN: rm -rf %t
1414
// RUN: mkdir -p %t
15-
// RUN: %target-build-swift %s -o %t/a.out -Xfrontend -enable-experimental-subclass-existentials
15+
// RUN: %target-build-swift %s -o %t/a.out
1616
// RUN: %target-run %t/a.out
1717
// REQUIRES: executable_test
1818
// REQUIRES: objc_interop

test/PrintAsObjC/protocols.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// 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
1010
// FIXME: END -enable-source-import hackaround
1111

12-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -I %t -emit-module -o %t %s -disable-objc-attr-requires-foundation-module -enable-experimental-subclass-existentials
13-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -I %t -parse-as-library %t/protocols.swiftmodule -typecheck -emit-objc-header-path %t/protocols.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -enable-experimental-subclass-existentials
12+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -I %t -emit-module -o %t %s -disable-objc-attr-requires-foundation-module
13+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -I %t -parse-as-library %t/protocols.swiftmodule -typecheck -emit-objc-header-path %t/protocols.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
1414
// RUN: %FileCheck %s < %t/protocols.h
1515
// RUN: %FileCheck --check-prefix=NEGATIVE %s < %t/protocols.h
1616
// RUN: %check-in-clang %t/protocols.h

test/SILGen/subclass_existentials.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -emit-silgen -parse-as-library -enable-experimental-subclass-existentials -primary-file %s -verify | %FileCheck %s
2-
// RUN: %target-swift-frontend -emit-ir -parse-as-library -enable-experimental-subclass-existentials -primary-file %s
1+
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -emit-silgen -parse-as-library -primary-file %s -verify | %FileCheck %s
2+
// RUN: %target-swift-frontend -emit-ir -parse-as-library -primary-file %s
33

44
// Note: we pass -verify above to ensure there are no spurious
55
// compiler warnings relating to casts.

test/type/subclass_composition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -enable-experimental-subclass-existentials
1+
// RUN: %target-typecheck-verify-swift
22

33
protocol P1 {
44
typealias DependentInConcreteConformance = Self

test/type/subclass_composition_objc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -enable-experimental-subclass-existentials -disable-objc-attr-requires-foundation-module
1+
// RUN: %target-typecheck-verify-swift -disable-objc-attr-requires-foundation-module
22

33
@objc class ObjCClass {}
44
@objc protocol ObjCProtocol {}

tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,8 +2622,6 @@ static int doReconstructType(const CompilerInvocation &InitInvok,
26222622
CompilerInvocation Invocation(InitInvok);
26232623
Invocation.addInputFilename(SourceFilename);
26242624
Invocation.getLangOptions().DisableAvailabilityChecking = false;
2625-
// This is temporary
2626-
Invocation.getLangOptions().EnableExperimentalSubclassExistentials = true;
26272625

26282626
CompilerInstance CI;
26292627

0 commit comments

Comments
 (0)