mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 23:10:28 +00:00
Enable SubobjectDestroy.Op to destroy array elements (#7844)
This is a partial implementation of #7362.
This commit is contained in:
1 parent
12e1afeb15
commit
c1492aab75
29 files changed
+1554
-3
No files matched your search
@@ -123,6 +123,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_23.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_23.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.c42: %pattern_type.771 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.3bc: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt.c42 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_23.2 [concrete]
|
||||
@@ -475,6 +477,18 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_23.2(%self.param: ref %array_type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc10_23.1: ref %i32 = array_index %self.param, %int_2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_23.1: <bound method> = bound_method %.loc10_23.1, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_23.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_23.1(%.loc10_23.1)
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc10_23.2: ref %i32 = array_index %self.param, %int_1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_23.2: <bound method> = bound_method %.loc10_23.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_23.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_23.2(%.loc10_23.2)
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %.loc10_23.3: ref %i32 = array_index %self.param, %int_0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_23.3: <bound method> = bound_method %.loc10_23.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_23.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_23.3(%.loc10_23.3)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in new issue
Block a user