File tree Expand file tree Collapse file tree 4 files changed +34
-1
lines changed Expand file tree Collapse file tree 4 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -4067,8 +4067,10 @@ IRGenModule::getAddrOfGlobalUTF16ConstantString(StringRef utf8) {
4067
4067
// / - For classes, the superclass might change the size or number
4068
4068
// / of stored properties
4069
4069
bool IRGenModule::isResilient (NominalTypeDecl *D, ResilienceExpansion expansion) {
4070
- if (Types.isCompletelyFragile ())
4070
+ if (expansion == ResilienceExpansion::Maximal &&
4071
+ Types.isCompletelyFragile ()) {
4071
4072
return false ;
4073
+ }
4072
4074
return D->isResilient (getSwiftModule (), expansion);
4073
4075
}
4074
4076
Original file line number Diff line number Diff line change
1
+ public class C { }
2
+
3
+ public struct S {
4
+ public let c : C
5
+
6
+ public init ( ) {
7
+ self . c = C ( )
8
+ }
9
+ }
Original file line number Diff line number Diff line change
1
+ import first
2
+
3
+ public enum E {
4
+ case a( S )
5
+ case b( S )
6
+ }
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+
3
+ // RUN: %target-swift-frontend -emit-module -enable-resilience -emit-module-path=%t/first.swiftmodule -module-name=first %S/Inputs/resilience_bypass/first.swift
4
+ // RUN: %target-swift-frontend -emit-module -emit-module-path=%t/second.swiftmodule -module-name=second %S/Inputs/resilience_bypass/second.swift -I %t
5
+ // RUN: %target-swift-frontend -emit-ir -enable-resilience-bypass %s -I %t | %FileCheck %s -DINT=i%target-ptrsize
6
+
7
+ import second
8
+
9
+ // CHECK: define{{( protected)?}} swiftcc [[INT]] @"$S17resilience_bypass7getSizeSiyF"() {{.*}} {
10
+ // CHECK-NEXT: entry:
11
+ // CHECK-NEXT: ret [[INT]] {{5|9}}
12
+ // CHECK-NEXT: }
13
+
14
+ public func getSize( ) -> Int {
15
+ return MemoryLayout< E> . size
16
+ }
You can’t perform that action at this time.
0 commit comments