Use @inout result convention for mutate accessors

This commit is contained in:
Meghana Gupta
2025-10-14 15:05:25 -07:00
parent 25af94495c
commit a0c939bd3b
24 changed files with 128 additions and 42 deletions

View File

@@ -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) -> ()