Skip to content

Commit 6af8d18

Browse files
committed
IRGen: Remove -enable-class-resilience staging flag
1 parent 66ba75c commit 6af8d18

File tree

8 files changed

+10
-32
lines changed

8 files changed

+10
-32
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,6 @@ namespace swift {
199199
/// accesses.
200200
bool DisableTsanInoutInstrumentation = false;
201201

202-
/// \brief Staging flag for class resilience, which we do not want to enable
203-
/// fully until more code is in place, to allow the standard library to be
204-
/// tested with value type resilience only.
205-
bool EnableClassResilience = false;
206-
207202
/// Should we check the target OSs of serialized modules to see that they're
208203
/// new enough?
209204
bool EnableTargetOSChecking = true;

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,6 @@ def enable_resilience : Flag<["-"], "enable-resilience">,
442442
HelpText<"Compile the module to export resilient interfaces for all "
443443
"public declarations by default">;
444444

445-
def enable_class_resilience : Flag<["-"], "enable-class-resilience">,
446-
HelpText<"Compile the module to export resilient interfaces for all "
447-
"public classes by default (doesn't work yet)">;
448-
449445
def group_info_path : Separate<["-"], "group-info-path">,
450446
HelpText<"The path to collect the group information of the compiled module">;
451447

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,9 +1011,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
10111011
Opts.EnableExperimentalPropertyBehaviors |=
10121012
Args.hasArg(OPT_enable_experimental_property_behaviors);
10131013

1014-
Opts.EnableClassResilience |=
1015-
Args.hasArg(OPT_enable_class_resilience);
1016-
10171014
if (auto A = Args.getLastArg(OPT_enable_deserialization_recovery,
10181015
OPT_disable_deserialization_recovery)) {
10191016
Opts.EnableDeserializationRecovery

lib/IRGen/ClassMetadataVisitor.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ template <class Impl> class ClassMetadataVisitor
9393
// Visit the superclass first.
9494
if (Type superclass = type->getSuperclass()) {
9595
auto *superclassDecl = superclass->getClassOrBoundGenericClass();
96-
if (IGM.Context.LangOpts.EnableClassResilience &&
97-
IGM.isResilient(superclassDecl, ResilienceExpansion::Maximal)) {
96+
if (IGM.isResilient(superclassDecl, ResilienceExpansion::Maximal)) {
9897
// Just note that we have a resilient superclass and move on.
9998
//
10099
// Runtime metadata instantiation needs to slide our entries down

lib/IRGen/GenClass.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,6 @@ namespace {
295295

296296
// If the superclass is resilient to us, we cannot statically
297297
// know the layout of either its instances or its class objects.
298-
//
299-
// FIXME: We need to implement indirect field/vtable entry access
300-
// before we can enable this
301-
if (!IGM.Context.LangOpts.EnableClassResilience) {
302-
addFieldsForClass(superclass, superclassType);
303-
NumInherited = Elements.size();
304-
}
305-
306298
ClassHasFixedSize = false;
307299

308300
// Furthermore, if the superclass is a generic context, we have to

lib/IRGen/MetadataLayout.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ ClassMetadataLayout::ClassMetadataLayout(IRGenModule &IGM, ClassDecl *decl)
251251
// to us, we will access metadata members relative to a base offset.
252252
if (forClass == Target) {
253253
if (Layout.HasResilientSuperclass ||
254-
(IGM.Context.LangOpts.EnableClassResilience &&
255-
IGM.isResilient(forClass, ResilienceExpansion::Maximal))) {
254+
IGM.isResilient(forClass, ResilienceExpansion::Maximal)) {
256255
assert(!DynamicOffsetBase);
257256
DynamicOffsetBase = NextOffset;
258257
}

test/IRGen/class_resilience.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -enable-resilience -enable-class-resilience -emit-module-path=%t/resilient_struct.swiftmodule -module-name=resilient_struct %S/../Inputs/resilient_struct.swift
3-
// RUN: %target-swift-frontend -emit-module -enable-resilience -enable-class-resilience -emit-module-path=%t/resilient_enum.swiftmodule -module-name=resilient_enum -I %t %S/../Inputs/resilient_enum.swift
4-
// RUN: %target-swift-frontend -emit-module -enable-resilience -enable-class-resilience -emit-module-path=%t/resilient_class.swiftmodule -module-name=resilient_class -I %t %S/../Inputs/resilient_class.swift
5-
// RUN: %target-swift-frontend -I %t -emit-ir -enable-resilience -enable-class-resilience %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
6-
// RUN: %target-swift-frontend -I %t -emit-ir -enable-resilience -enable-class-resilience -O %s
2+
// RUN: %target-swift-frontend -emit-module -enable-resilience -emit-module-path=%t/resilient_struct.swiftmodule -module-name=resilient_struct %S/../Inputs/resilient_struct.swift
3+
// RUN: %target-swift-frontend -emit-module -enable-resilience -emit-module-path=%t/resilient_enum.swiftmodule -module-name=resilient_enum -I %t %S/../Inputs/resilient_enum.swift
4+
// RUN: %target-swift-frontend -emit-module -enable-resilience -emit-module-path=%t/resilient_class.swiftmodule -module-name=resilient_class -I %t %S/../Inputs/resilient_class.swift
5+
// RUN: %target-swift-frontend -I %t -emit-ir -enable-resilience %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
6+
// RUN: %target-swift-frontend -I %t -emit-ir -enable-resilience -O %s
77

88
// CHECK: %swift.type = type { [[INT:i32|i64]] }
99

test/IRGen/super.sil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module -enable-resilience -enable-class-resilience -I %t -module-name resilient_struct -o %t %S/../Inputs/resilient_struct.swift
3-
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module -enable-resilience -enable-class-resilience -I %t -module-name resilient_class -o %t %S/../Inputs/resilient_class.swift
4-
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -enable-resilience -enable-class-resilience -parse-sil -parse-as-library -emit-ir -I %t %s | %FileCheck %s
2+
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module -enable-resilience -I %t -module-name resilient_struct -o %t %S/../Inputs/resilient_struct.swift
3+
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module -enable-resilience -I %t -module-name resilient_class -o %t %S/../Inputs/resilient_class.swift
4+
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -enable-resilience -parse-sil -parse-as-library -emit-ir -I %t %s | %FileCheck %s
55

66
// CHECK: %swift.type = type { [[INT:i32|i64]] }
77

0 commit comments

Comments
 (0)