mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add Destroy.SubobjectDestroy as a temporary replacement for Destroy.Op (#7773)
This change partially implements [PR #7362], which revises how objects are destroyed. It is a partial implementation for two reasons: 1. This change moves `Destroy.Op`'s current behaviour into `Destroy.SubobjectDestroy`, but it doesn't add support for objects with non-trivial destruction. 2. `Destroy.SubobjectDestroy` is a workaround for `require impls SubobjectDestroy`. We aren't able to use the latter until the dependents add their requirements' implementations to their own witness tables. [PR #7362]: https://github.com/carbon-language/carbon-lang/pulls/7362
This commit is contained in:
+269
-76
@@ -423,10 +423,14 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %ptr.ca8: type = ptr_type %Dest [concrete]
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk.type.eb4c5e.1: type = fn_type @Dest__carbon_thunk.1 [concrete]
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk.c8e433.1: %Dest__carbon_thunk.type.eb4c5e.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.581: %pattern_type.b72 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.48a: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt.581 [concrete]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.type: type = fn_type @Dest.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor: %Dest.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Dest.Op.type: type = fn_type @Dest.Op [concrete]
|
||||
// CHECK:STDOUT: %Dest.Op: %Dest.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %NonConstConversion.689: type = class_type @NonConstConversion.1 [concrete]
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk.type.eb4c5e.2: type = fn_type @Dest__carbon_thunk.2 [concrete]
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk.c8e433.2: %Dest__carbon_thunk.type.eb4c5e.2 = struct_value () [concrete]
|
||||
@@ -438,10 +442,14 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %ptr.802: type = ptr_type %Dest2 [concrete]
|
||||
// CHECK:STDOUT: %Dest2__carbon_thunk.type: type = fn_type @Dest2__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %Dest2__carbon_thunk: %Dest2__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.2f7: %pattern_type.a68 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.7db: %pattern_type.a68 = wrapper_binding_pattern self, %self.param_patt.2f7 [concrete]
|
||||
// CHECK:STDOUT: %Dest2.cpp_destructor.type: type = fn_type @Dest2.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %Dest2.cpp_destructor: %Dest2.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Dest2.Op.type: type = fn_type @Dest2.Op [concrete]
|
||||
// CHECK:STDOUT: %Dest2.Op: %Dest2.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -485,6 +493,23 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.b72 = ref_param_pattern [concrete = constants.%self.param_patt.581]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48a]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %Dest = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %Dest = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.a68 = ref_param_pattern [concrete = constants.%self.param_patt.2f7]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.a68 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7db]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %Dest2 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %Dest2 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @UserConversion(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
@@ -504,13 +529,20 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Dest.Op.bound: <bound method> = bound_method %.loc8_21.4, constants.%Dest.Op
|
||||
// CHECK:STDOUT: %Op.ref: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.bound: <bound method> = bound_method %.loc8_21.4, %Op.ref
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call %Dest.cpp_destructor.bound(%.loc8_21.4)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc8_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_21.4)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %Dest) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %Dest) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @NonConstConversion.loc12(%s.param: ref %NonConstConversion.689) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: ref %NonConstConversion.689 = name_ref s, %s
|
||||
@@ -529,10 +561,8 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Dest.Op.bound: <bound method> = bound_method %.loc14_21.4, constants.%Dest.Op
|
||||
// CHECK:STDOUT: %Op.ref: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.bound: <bound method> = bound_method %.loc14_21.4, %Op.ref
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call %Dest.cpp_destructor.bound(%.loc14_21.4)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc14_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc14_21.4)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -557,13 +587,20 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.a68 = value_binding_pattern _ [concrete = constants.%_.patt.ff1]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Dest2.Op.bound: <bound method> = bound_method %.loc20_22.5, constants.%Dest2.Op
|
||||
// CHECK:STDOUT: %Op.ref: %Dest2.cpp_destructor.type = name_ref Op, imports.%Dest2.cpp_destructor.decl [concrete = constants.%Dest2.cpp_destructor]
|
||||
// CHECK:STDOUT: %Dest2.cpp_destructor.bound: <bound method> = bound_method %.loc20_22.5, %Op.ref
|
||||
// CHECK:STDOUT: %Dest2.cpp_destructor.call: init %empty_tuple.type = call %Dest2.cpp_destructor.bound(%.loc20_22.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc20_22.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc20_22.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20(%self.param: ref %Dest2) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20(%self.param: ref %Dest2) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %Dest2.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest2.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_expr_category.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -612,10 +649,14 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %ptr.859: type = ptr_type %InaccessibleConstructor [concrete]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk.type: type = fn_type @InaccessibleConstructor__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk: %InaccessibleConstructor__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.244: %pattern_type.824 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.2ae: %pattern_type.824 = wrapper_binding_pattern self, %self.param_patt.244 [concrete]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.type: type = fn_type @InaccessibleConstructor.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor: %InaccessibleConstructor.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.Op.type: type = fn_type @InaccessibleConstructor.Op [concrete]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.Op: %InaccessibleConstructor.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %InaccessibleConversion: type = class_type @InaccessibleConversion [concrete]
|
||||
// CHECK:STDOUT: %Dest: type = class_type @Dest [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.b72: type = pattern_type %Dest [concrete]
|
||||
@@ -623,10 +664,14 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %ptr.ca8: type = ptr_type %Dest [concrete]
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk.type: type = fn_type @Dest__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk: %Dest__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.581: %pattern_type.b72 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.48a: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt.581 [concrete]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.type: type = fn_type @Dest.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor: %Dest.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Dest.Op.type: type = fn_type @Dest.Op [concrete]
|
||||
// CHECK:STDOUT: %Dest.Op: %Dest.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc30 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc30 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -663,6 +708,23 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.824 = ref_param_pattern [concrete = constants.%self.param_patt.244]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.824 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2ae]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %InaccessibleConstructor = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %InaccessibleConstructor = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc30 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.b72 = ref_param_pattern [concrete = constants.%self.param_patt.581]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48a]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %Dest = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %Dest = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InaccessibleConstructorTest(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
@@ -684,13 +746,20 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.824 = value_binding_pattern _ [concrete = constants.%_.patt.f1f]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.Op.bound: <bound method> = bound_method %.loc16_40.5, constants.%InaccessibleConstructor.Op
|
||||
// CHECK:STDOUT: %Op.ref: %InaccessibleConstructor.cpp_destructor.type = name_ref Op, imports.%InaccessibleConstructor.cpp_destructor.decl [concrete = constants.%InaccessibleConstructor.cpp_destructor]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.bound: <bound method> = bound_method %.loc16_40.5, %Op.ref
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.call: init %empty_tuple.type = call %InaccessibleConstructor.cpp_destructor.bound(%.loc16_40.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc16_40.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc16_40.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %InaccessibleConstructor) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %InaccessibleConstructor) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%InaccessibleConstructor.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InaccessibleConversionTest(%s.param: %InaccessibleConversion) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %InaccessibleConversion = name_ref s, %s
|
||||
@@ -710,13 +779,20 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Dest.Op.bound: <bound method> = bound_method %.loc30_21.4, constants.%Dest.Op
|
||||
// CHECK:STDOUT: %Op.ref: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.bound: <bound method> = bound_method %.loc30_21.4, %Op.ref
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call %Dest.cpp_destructor.bound(%.loc30_21.4)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc30_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc30_21.4)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30(%self.param: ref %Dest) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc30(%self.param: ref %Dest) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_deleted.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -846,10 +922,14 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %ptr.100: type = ptr_type %IntConstructor.372 [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor__carbon_thunk.type: type = fn_type @IntConstructor__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor__carbon_thunk: %IntConstructor__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.ab8: %pattern_type.c4e = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.f11: %pattern_type.c4e = wrapper_binding_pattern self, %self.param_patt.ab8 [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor.type: type = fn_type @IntConstructor.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor: %IntConstructor.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor.Op.type: type = fn_type @IntConstructor.Op [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor.Op: %IntConstructor.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -870,6 +950,16 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.c4e = ref_param_pattern [concrete = constants.%self.param_patt.ab8]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.c4e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f11]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %IntConstructor.372 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %IntConstructor.372 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @IntConstructor.loc6(%i.param: %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %i.ref: %i32 = name_ref i, %i
|
||||
@@ -889,13 +979,20 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.c4e = value_binding_pattern _ [concrete = constants.%_.patt.151]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %IntConstructor.Op.bound: <bound method> = bound_method %.loc8_31.4, constants.%IntConstructor.Op
|
||||
// CHECK:STDOUT: %Op.ref: %IntConstructor.cpp_destructor.type = name_ref Op, imports.%IntConstructor.cpp_destructor.decl [concrete = constants.%IntConstructor.cpp_destructor]
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor.bound: <bound method> = bound_method %.loc8_31.4, %Op.ref
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor.call: init %empty_tuple.type = call %IntConstructor.cpp_destructor.bound(%.loc8_31.4)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc8_31.4, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_31.4)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %IntConstructor.372) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %IntConstructor.372) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%IntConstructor.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_no_u32_to_int_conversion_in_carbon.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -910,10 +1007,14 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %ptr.100: type = ptr_type %IntConstructor [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor__carbon_thunk.type: type = fn_type @IntConstructor__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor__carbon_thunk: %IntConstructor__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.ab8: %pattern_type.c4e = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.f11: %pattern_type.c4e = wrapper_binding_pattern self, %self.param_patt.ab8 [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor.type: type = fn_type @IntConstructor.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor: %IntConstructor.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor.Op.type: type = fn_type @IntConstructor.Op [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor.Op: %IntConstructor.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -934,6 +1035,16 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.c4e = ref_param_pattern [concrete = constants.%self.param_patt.ab8]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.c4e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f11]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %IntConstructor = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %IntConstructor = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @IntConstructorTest(%u.param: %u32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %u.ref: %u32 = name_ref u, %u
|
||||
@@ -954,13 +1065,20 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.c4e = value_binding_pattern _ [concrete = constants.%_.patt.151]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %IntConstructor.Op.bound: <bound method> = bound_method %.loc19_31.5, constants.%IntConstructor.Op
|
||||
// CHECK:STDOUT: %Op.ref: %IntConstructor.cpp_destructor.type = name_ref Op, imports.%IntConstructor.cpp_destructor.decl [concrete = constants.%IntConstructor.cpp_destructor]
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor.bound: <bound method> = bound_method %.loc19_31.5, %Op.ref
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor.call: init %empty_tuple.type = call %IntConstructor.cpp_destructor.bound(%.loc19_31.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc19_31.5, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc19_31.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %IntConstructor) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %IntConstructor) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%IntConstructor.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- default_constructor.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -973,10 +1091,14 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %ptr.c09: type = ptr_type %DefaultConstructor [concrete]
|
||||
// CHECK:STDOUT: %DefaultConstructor__carbon_thunk.type: type = fn_type @DefaultConstructor__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %DefaultConstructor__carbon_thunk: %DefaultConstructor__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.91e: %pattern_type.be4 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.221: %pattern_type.be4 = wrapper_binding_pattern self, %self.param_patt.91e [concrete]
|
||||
// CHECK:STDOUT: %DefaultConstructor.cpp_destructor.type: type = fn_type @DefaultConstructor.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %DefaultConstructor.cpp_destructor: %DefaultConstructor.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %DefaultConstructor.Op.type: type = fn_type @DefaultConstructor.Op [concrete]
|
||||
// CHECK:STDOUT: %DefaultConstructor.Op: %DefaultConstructor.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -997,6 +1119,16 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.be4 = ref_param_pattern [concrete = constants.%self.param_patt.91e]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.be4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.221]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %DefaultConstructor = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %DefaultConstructor = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @DefaultConstructorTest() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc9_36.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
@@ -1016,13 +1148,20 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.be4 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %DefaultConstructor.Op.bound: <bound method> = bound_method %.loc9_36.5, constants.%DefaultConstructor.Op
|
||||
// CHECK:STDOUT: %Op.ref: %DefaultConstructor.cpp_destructor.type = name_ref Op, imports.%DefaultConstructor.cpp_destructor.decl [concrete = constants.%DefaultConstructor.cpp_destructor]
|
||||
// CHECK:STDOUT: %DefaultConstructor.cpp_destructor.bound: <bound method> = bound_method %.loc9_36.5, %Op.ref
|
||||
// CHECK:STDOUT: %DefaultConstructor.cpp_destructor.call: init %empty_tuple.type = call %DefaultConstructor.cpp_destructor.bound(%.loc9_36.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc9_36.5, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc9_36.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %DefaultConstructor) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %DefaultConstructor) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %DefaultConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%DefaultConstructor.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- construct_multi_argument.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -1071,14 +1210,22 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.485: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.763: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_3.410: %i32 = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.ed0: %pattern_type.248 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.dca: %pattern_type.248 = wrapper_binding_pattern self, %self.param_patt.ed0 [concrete]
|
||||
// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.type: type = fn_type @ThreeWithDefault.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor: %ThreeWithDefault.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ThreeWithDefault.Op.type: type = fn_type @ThreeWithDefault.Op [concrete]
|
||||
// CHECK:STDOUT: %ThreeWithDefault.Op: %ThreeWithDefault.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.df5: %pattern_type.586 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.e0a: %pattern_type.586 = wrapper_binding_pattern self, %self.param_patt.df5 [concrete]
|
||||
// CHECK:STDOUT: %Two.cpp_destructor.type: type = fn_type @Two.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %Two.cpp_destructor: %Two.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Two.Op.type: type = fn_type @Two.Op [concrete]
|
||||
// CHECK:STDOUT: %Two.Op: %Two.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -1118,6 +1265,23 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.248 = ref_param_pattern [concrete = constants.%self.param_patt.ed0]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.248 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.dca]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %ThreeWithDefault = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %ThreeWithDefault = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.586 = ref_param_pattern [concrete = constants.%self.param_patt.df5]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.586 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e0a]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %Two = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %Two = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @ImplicitConvert() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
@@ -1225,22 +1389,34 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %_.patt.loc12: %pattern_type.248 = value_binding_pattern _ [concrete = constants.%_.patt.368]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %ThreeWithDefault.Op.bound.loc12: <bound method> = bound_method %.loc12_41.5, constants.%ThreeWithDefault.Op
|
||||
// CHECK:STDOUT: %Op.ref.loc12: %ThreeWithDefault.cpp_destructor.type = name_ref Op, imports.%ThreeWithDefault.cpp_destructor.decl [concrete = constants.%ThreeWithDefault.cpp_destructor]
|
||||
// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.bound.loc12: <bound method> = bound_method %.loc12_41.5, %Op.ref.loc12
|
||||
// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.call.loc12: init %empty_tuple.type = call %ThreeWithDefault.cpp_destructor.bound.loc12(%.loc12_41.5)
|
||||
// CHECK:STDOUT: %ThreeWithDefault.Op.bound.loc10: <bound method> = bound_method %.loc10_38.5, constants.%ThreeWithDefault.Op
|
||||
// CHECK:STDOUT: %Op.ref.loc10: %ThreeWithDefault.cpp_destructor.type = name_ref Op, imports.%ThreeWithDefault.cpp_destructor.decl [concrete = constants.%ThreeWithDefault.cpp_destructor]
|
||||
// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.bound.loc10: <bound method> = bound_method %.loc10_38.5, %Op.ref.loc10
|
||||
// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.call.loc10: init %empty_tuple.type = call %ThreeWithDefault.cpp_destructor.bound.loc10(%.loc10_38.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: <bound method> = bound_method %.loc12_41.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%.loc12_41.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: <bound method> = bound_method %.loc10_38.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_38.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Two.Op.bound: <bound method> = bound_method %.loc8_25.5, constants.%Two.Op
|
||||
// CHECK:STDOUT: %Op.ref.loc8: %Two.cpp_destructor.type = name_ref Op, imports.%Two.cpp_destructor.decl [concrete = constants.%Two.cpp_destructor]
|
||||
// CHECK:STDOUT: %Two.cpp_destructor.bound: <bound method> = bound_method %.loc8_25.5, %Op.ref.loc8
|
||||
// CHECK:STDOUT: %Two.cpp_destructor.call: init %empty_tuple.type = call %Two.cpp_destructor.bound(%.loc8_25.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %.loc8_25.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_25.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %ThreeWithDefault) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %ThreeWithDefault) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.call: init %empty_tuple.type = call imports.%ThreeWithDefault.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %Two) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %Two) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %Two.cpp_destructor.call: init %empty_tuple.type = call imports.%Two.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_todo_aggregate_from_tuple.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -1408,10 +1584,14 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.9f3: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.3cb: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_2.295: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.06a: %pattern_type.273 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.968: %pattern_type.273 = wrapper_binding_pattern self, %self.param_patt.06a [concrete]
|
||||
// CHECK:STDOUT: %NonAggregate.cpp_destructor.type: type = fn_type @NonAggregate.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %NonAggregate.cpp_destructor: %NonAggregate.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %NonAggregate.Op.type: type = fn_type @NonAggregate.Op [concrete]
|
||||
// CHECK:STDOUT: %NonAggregate.Op: %NonAggregate.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -1444,6 +1624,16 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.273 = ref_param_pattern [concrete = constants.%self.param_patt.06a]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.273 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.968]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %NonAggregate = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %NonAggregate = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InitFromStruct() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc8_30.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
@@ -1519,21 +1709,24 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %_.patt.loc10: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %NonAggregate.Op.bound.loc10: <bound method> = bound_method %.loc10_34.5, constants.%NonAggregate.Op
|
||||
// CHECK:STDOUT: %Op.ref.loc10: %NonAggregate.cpp_destructor.type = name_ref Op, imports.%NonAggregate.cpp_destructor.decl [concrete = constants.%NonAggregate.cpp_destructor]
|
||||
// CHECK:STDOUT: %NonAggregate.cpp_destructor.bound.loc10: <bound method> = bound_method %.loc10_34.5, %Op.ref.loc10
|
||||
// CHECK:STDOUT: %NonAggregate.cpp_destructor.call.loc10: init %empty_tuple.type = call %NonAggregate.cpp_destructor.bound.loc10(%.loc10_34.5)
|
||||
// CHECK:STDOUT: %NonAggregate.Op.bound.loc9: <bound method> = bound_method %.loc9_32.5, constants.%NonAggregate.Op
|
||||
// CHECK:STDOUT: %Op.ref.loc9: %NonAggregate.cpp_destructor.type = name_ref Op, imports.%NonAggregate.cpp_destructor.decl [concrete = constants.%NonAggregate.cpp_destructor]
|
||||
// CHECK:STDOUT: %NonAggregate.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_32.5, %Op.ref.loc9
|
||||
// CHECK:STDOUT: %NonAggregate.cpp_destructor.call.loc9: init %empty_tuple.type = call %NonAggregate.cpp_destructor.bound.loc9(%.loc9_32.5)
|
||||
// CHECK:STDOUT: %NonAggregate.Op.bound.loc8: <bound method> = bound_method %.loc8_30.5, constants.%NonAggregate.Op
|
||||
// CHECK:STDOUT: %Op.ref.loc8: %NonAggregate.cpp_destructor.type = name_ref Op, imports.%NonAggregate.cpp_destructor.decl [concrete = constants.%NonAggregate.cpp_destructor]
|
||||
// CHECK:STDOUT: %NonAggregate.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_30.5, %Op.ref.loc8
|
||||
// CHECK:STDOUT: %NonAggregate.cpp_destructor.call.loc8: init %empty_tuple.type = call %NonAggregate.cpp_destructor.bound.loc8(%.loc8_30.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: <bound method> = bound_method %.loc10_34.5, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_34.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: <bound method> = bound_method %.loc9_32.5, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_32.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %.loc8_30.5, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_30.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %NonAggregate) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %NonAggregate) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %NonAggregate.cpp_destructor.call: init %empty_tuple.type = call imports.%NonAggregate.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_non_aggregate_from_struct.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
|
||||
Reference in New Issue
Block a user