mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Use @inout result convention for mutate accessors
This commit is contained in:
@@ -26,6 +26,20 @@ bb0(%0 : $*GenWrapper<T>):
|
||||
return %2
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil [ossa] @mutate_loadable_prop : $@convention(method) (@inout Wrapper) -> @inout Klass {
|
||||
sil [ossa] @mutate_loadable_prop : $@convention(method) (@inout Wrapper) -> @inout Klass {
|
||||
bb0(%0 : $*Wrapper):
|
||||
%2 = struct_element_addr %0, #Wrapper._k
|
||||
return %2
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil [ossa] @mutate_addressonly_prop : $@convention(method) <T> (@inout GenWrapper<T>) -> @inout T {
|
||||
sil [ossa] @mutate_addressonly_prop : $@convention(method) <T> (@inout GenWrapper<T>) -> @inout T {
|
||||
bb0(%0 : $*GenWrapper<T>):
|
||||
%2 = struct_element_addr %0, #GenWrapper._prop
|
||||
return %2
|
||||
}
|
||||
|
||||
sil @get_wrapper : $@convention(thin) () -> @owned Klass
|
||||
sil @use_klass : $@convention(thin) (@guaranteed Klass) -> ()
|
||||
sil @use_T : $@convention(thin) <T> (@in_guaranteed T) -> ()
|
||||
|
||||
Reference in New Issue
Block a user