File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -956,9 +956,8 @@ bool SILGenModule::hasNonTrivialIVars(ClassDecl *cd) {
956
956
auto *vd = dyn_cast<VarDecl>(member);
957
957
if (!vd || !vd->hasStorage ()) continue ;
958
958
959
- // FIXME: Expansion
960
959
auto &ti = Types.getTypeLowering (vd->getType (),
961
- ResilienceExpansion::Minimal );
960
+ ResilienceExpansion::Maximal );
962
961
if (!ti.isTrivial ())
963
962
return true ;
964
963
}
Original file line number Diff line number Diff line change
1
+
2
+ // RUN: %empty-directory(%t)
3
+ // RUN: %target-swift-frontend -emit-module -enable-resilience -emit-module-path=%t/resilient_struct.swiftmodule -enable-sil-ownership %S/../Inputs/resilient_struct.swift
4
+ // RUN: %target-swift-emit-silgen -I %t -enable-sil-ownership -enable-resilience %s | %FileCheck %s
5
+
6
+ import resilient_struct
7
+
8
+ public class Base { }
9
+
10
+ public struct MyResilientInt {
11
+ var i : Int
12
+
13
+ public init ( i: Int ) { self . i = i }
14
+ }
15
+
16
+ public class NeedsIVarDetroyer : Base {
17
+ var x = ResilientInt ( i: 0 )
18
+ }
19
+
20
+ public class DoesNotNeedIVarDestroyer : Base {
21
+ var x = MyResilientInt ( i: 0 )
22
+ }
23
+
24
+ // CHECK-LABEL: sil_vtable NeedsIVarDetroyer {
25
+ // CHECK-NEXT: #Base.init!allocator.1: (Base.Type) -> () -> Base
26
+ // CHECK-NEXT: #NeedsIVarDetroyer.x!getter.1: (NeedsIVarDetroyer) -> () -> resilient_struct.ResilientInt
27
+ // CHECK-NEXT: #NeedsIVarDetroyer.x!setter.1: (NeedsIVarDetroyer) -> (resilient_struct.ResilientInt) -> ()
28
+ // CHECK-NEXT: #NeedsIVarDetroyer.x!modify.1: (NeedsIVarDetroyer) -> () -> ()
29
+ // CHECK-NEXT: #NeedsIVarDetroyer.deinit!deallocator.1
30
+ // CHECK-NEXT: #NeedsIVarDetroyer!ivardestroyer.1
31
+ // CHECK-NEXT: }
32
+
33
+ // CHECK-LABEL: sil_vtable DoesNotNeedIVarDestroyer {
34
+ // CHECK-NEXT: #Base.init!allocator.1: (Base.Type) -> () -> Base
35
+ // CHECK-NEXT: #DoesNotNeedIVarDestroyer.x!getter.1: (DoesNotNeedIVarDestroyer) -> () -> MyResilientInt
36
+ // CHECK-NEXT: #DoesNotNeedIVarDestroyer.x!setter.1: (DoesNotNeedIVarDestroyer) -> (MyResilientInt) -> ()
37
+ // CHECK-NEXT: #DoesNotNeedIVarDestroyer.x!modify.1: (DoesNotNeedIVarDestroyer) -> () -> ()
38
+ // CHECK-NEXT: #DoesNotNeedIVarDestroyer.deinit!deallocator.1
39
+ // CHECK-NEXT: }
You can’t perform that action at this time.
0 commit comments