@@ -11,6 +11,8 @@ struct MyInt {
1111
1212struct MyBool {}
1313
14+ class Storage {}
15+
1416struct _MyBridgeStorage {
1517 @_hasStorage var rawValue : Builtin.BridgeObject
1618}
5153 %5 = function_ref @adoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
5254 %6 = apply %5(%2, %3, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
5355 (%7, %8a) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
54- %8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
56+ %i1 = begin_borrow %7
57+ %i2 = struct_extract %i1, #MyArray._buffer
58+ %i3 = struct_extract %i2, #_MyArrayBuffer._storage
59+ %i4 = struct_extract %i3, #_MyBridgeStorage.rawValue
60+ %i5 = unchecked_ref_cast %i4 to $Storage
61+ %i6 = ref_tail_addr %i5, $MyInt
62+ end_borrow %i1
5563 debug_value %7 : $MyArray<MyInt>
5664 %f = function_ref @finalize : $@convention(thin) (@owned MyArray<MyInt>) -> @owned MyArray<MyInt>
5765 %a = apply %f(%7) : $@convention(thin) (@owned MyArray<MyInt>) -> @owned MyArray<MyInt>
7583 %5 = function_ref @allocateUninitialized : $@convention(thin) (MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
7684 %6 = apply %5(%3, %4) : $@convention(thin) (MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
7785 (%7, %8a) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
78- %8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
86+ %i1 = begin_borrow %7
87+ %i2 = struct_extract %i1, #MyArray._buffer
88+ %i3 = struct_extract %i2, #_MyArrayBuffer._storage
89+ %i4 = struct_extract %i3, #_MyBridgeStorage.rawValue
90+ %i5 = unchecked_ref_cast %i4 to $Storage
91+ %i6 = ref_tail_addr %i5, $MyInt
92+ end_borrow %i1
7993 debug_value %7 : $MyArray<MyInt>
8094 %9 = function_ref @getCount : $@convention(method) (@guaranteed MyArray<MyInt>) -> MyInt
8195 %10 = apply %9(%7) : $@convention(method) (@guaranteed MyArray<MyInt>) -> MyInt
@@ -131,7 +145,13 @@ bb0:
131145 %5 = function_ref @adoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
132146 %6 = apply %5(%2, %3, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
133147 (%7, %8a) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
134- %8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
148+ %i1 = begin_borrow %7
149+ %i2 = struct_extract %i1, #MyArray._buffer
150+ %i3 = struct_extract %i2, #_MyArrayBuffer._storage
151+ %i4 = struct_extract %i3, #_MyBridgeStorage.rawValue
152+ %i5 = unchecked_ref_cast %i4 to $Storage
153+ %i6 = ref_tail_addr %i5, $MyInt
154+ end_borrow %i1
135155 %copy7 = copy_value %7 : $MyArray<MyInt>
136156 debug_value %7 : $MyArray<MyInt>
137157 store %7 to [init] %15 : $*MyArray<MyInt>
@@ -159,7 +179,13 @@ bb0:
159179 %5 = function_ref @adoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
160180 %6 = apply %5(%2, %3, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
161181 (%7, %8a) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
162- %8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
182+ %i1 = begin_borrow %7
183+ %i2 = struct_extract %i1, #MyArray._buffer
184+ %i3 = struct_extract %i2, #_MyArrayBuffer._storage
185+ %i4 = struct_extract %i3, #_MyBridgeStorage.rawValue
186+ %i5 = unchecked_ref_cast %i4 to $Storage
187+ %i6 = ref_tail_addr %i5, $MyInt
188+ end_borrow %i1
163189 debug_value %7 : $MyArray<MyInt>
164190 %15 = function_ref @mayWrite : $@convention(thin) (@guaranteed MyArray<MyInt>) -> ()
165191 %16 = apply %15(%7) : $@convention(thin) (@guaranteed MyArray<MyInt>) -> ()
0 commit comments