File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ func test1() -> Int32 {
9797// CHECK: [[PTR:%.*]] = apply [[ACCESSOR]]({{%.*}}, [[A]]) : $@convention(method) (Int32, A) -> UnsafePointer<Int32>
9898// CHECK: [[T0:%.*]] = struct_extract [[PTR]] : $UnsafePointer<Int32>, #UnsafePointer._rawValue
9999// CHECK: [[T1:%.*]] = pointer_to_address [[T0]] : $Builtin.RawPointer to [strict] $*Int32
100- // CHECK: [[MD:%.*]] = mark_dependence [nonescaping] [ [T1]] : $*Int32 on [[A]] : $A
100+ // CHECK: [[MD:%.*]] = mark_dependence [[T1]] : $*Int32 on [[A]] : $A
101101// CHECK: [[ACCESS:%.*]] = begin_access [read] [unsafe] [[MD]] : $*Int32
102102// CHECK: [[T2:%.*]] = load [[ACCESS]] : $*Int32
103103// CHECK: return [[T2]] : $Int32
Original file line number Diff line number Diff line change @@ -95,10 +95,15 @@ func testSMod(s: inout S) {
9595 mod ( & s. mutableData)
9696}
9797
98+ // Accessing s.data causes an escaping dependence because we don't extend the local access scope of 's'.
99+ //
100+ // TODO: could we notice the local access is already nested inside the same kind of access (modify) and consider this to
101+ // be 'mark_dependence [nonescaping]'?
102+ //
98103// CHECK-LABEL: sil hidden @$s4main16testSInoutBorrow5mut_syAA1SVz_tF : $@convention(thin) (@inout S) -> () {
99104// CHECK: [[ACCESS:%.*]] = begin_access [read] [static] %0
100105// CHECK: [[ADR:%.*]] = pointer_to_address %{{.*}} to [strict] $*NC
101- // CHECK: [[MD:%.*]] = mark_dependence [nonescaping] [ [ADR]] on [[ACCESS]]
106+ // CHECK: [[MD:%.*]] = mark_dependence [[ADR]] on [[ACCESS]]
102107// CHECK: begin_access [read] [unsafe] [[MD]]
103108// CHECK: apply
104109// CHECK: end_access
You can’t perform that action at this time.
0 commit comments