File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2651,6 +2651,13 @@ class UseRewriter : SILInstructionVisitor<UseRewriter> {
2651
2651
2652
2652
void visitEndBorrowInst (EndBorrowInst *end) {}
2653
2653
2654
+ void visitFixLifetimeInst (FixLifetimeInst *fli) {
2655
+ SILValue value = fli->getOperand ();
2656
+ SILValue address = pass.valueStorageMap .getStorage (value).storageAddress ;
2657
+ builder.createFixLifetime (fli->getLoc (), address);
2658
+ pass.deleter .forceDelete (fli);
2659
+ }
2660
+
2654
2661
void visitBranchInst (BranchInst *) {
2655
2662
pass.getPhiRewriter ().materializeOperand (use);
2656
2663
Original file line number Diff line number Diff line change @@ -1228,6 +1228,18 @@ bb2(%9 : $Error):
1228
1228
throw %9 : $Error
1229
1229
}
1230
1230
1231
+ // CHECK-LABEL: sil [ossa] @fixeeLifetime : {{.*}} {
1232
+ // CHECK: {{bb[0-9]+}}([[ADDR:%[^,]+]] : $*T):
1233
+ // CHECK: fix_lifetime [[ADDR]]
1234
+ // CHECK-LABEL: } // end sil function 'fixeeLifetime'
1235
+ sil [ossa] @fixeeLifetime : $@convention(thin) <T> (@in T) -> () {
1236
+ bb0(%instance : @owned $T):
1237
+ fix_lifetime %instance : $T
1238
+ destroy_value %instance : $T
1239
+ %retval = tuple ()
1240
+ return %retval : $()
1241
+ }
1242
+
1231
1243
// CHECK-LABEL: sil [ossa] @lexical_borrow_struct_extract {{.*}} {
1232
1244
// CHECK: [[PAIR_ADDR:%[^,]+]] = alloc_stack [lexical]
1233
1245
// CHECK: [[X_ADDR:%[^,]+]] = struct_element_addr [[PAIR_ADDR]]
You can’t perform that action at this time.
0 commit comments