mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 22:02:51 +01:00
Change the Destroy blanket impls to be more specific (#6098)
The main direction of this change is the edits to `destroy.carbon` (matching in both prelude and min_prelude). Previously there was a no-op blanket impl for `Destroy`, which hid all missing implementations of `Destroy`. This does a few things: - Sets up builtin aggregate destruction for struct and tuple types as before, but also adds C++ class types and array types to the same handling. (all as a TODO for actual implementation) - Also maybe-unformed destruction, for now at least. (there's a chance I may try a different approach on this, but the impl lookup wasn't working as I'd hope in order to write it in code) - Adds handlers for simple things that are easy to do in code: `type`, `bool`, pointers. (because these are no-op destruction) - Redirect `const T` destruction to `T` destruction. This leaves as future issues: - `partial T` destruction. (this can't be done similar to `const` because it only works for non-`final` class types; I think `class` definitions should just generate what's needed) - Destruction of other prelude-provided types. (will probably come up as we implement class destruction, that the adapted builtin type doesn't implement `Destroy` -- but may end up special-casing that in a way that moots it) This moves the `&` operator from `facet_types.carbon` to `convert.carbon` because more things need to handle type and now that we're getting separate copy and destroy interfaces. It should be low-cost (an interface and builtin) so hopefully this is the right balance for complexity and re-use. A few tests are also edited in order to focus them more on what they intend to test, and avoid a `Destroy` dependency.
This commit is contained in:
+96
-60
@@ -269,8 +269,10 @@ fn F() {
|
||||
// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.d46: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%S) [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.062: %T.as.Destroy.impl.Op.type.d46 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.df1: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.cc2: %AggregateT.as_type.as.Destroy.impl.Op.type.df1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -297,8 +299,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %s.var: ref %S = var %s.var_patt
|
||||
// CHECK:STDOUT: %.loc8_19.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc8_19.2: init %S = class_init (), %s.var [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc8_3: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_3
|
||||
// CHECK:STDOUT: %.loc8_3.1: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_3.1
|
||||
// CHECK:STDOUT: %.loc8_13: type = splice_block %S.ref [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
@@ -309,11 +311,13 @@ fn F() {
|
||||
// CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %addr.loc9: %ptr.5c7 = addr_of %s.ref
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%addr.loc9)
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%T.as.Destroy.impl.Op.062
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%S, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%S, %facet_value [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.cc2
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %T.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %s.var
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8)
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -343,10 +347,12 @@ fn F() {
|
||||
// CHECK:STDOUT: %ptr.dfe: type = ptr_type %ptr.5c7 [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.929: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%ptr.5c7) [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.76a: %T.as.Destroy.impl.Op.type.929 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.d46: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%S) [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.062: %T.as.Destroy.impl.Op.type.d46 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
|
||||
// CHECK:STDOUT: %ptr.as.Destroy.impl.Op.type.c2a: type = fn_type @ptr.as.Destroy.impl.Op, @ptr.as.Destroy.impl(%S) [concrete]
|
||||
// CHECK:STDOUT: %ptr.as.Destroy.impl.Op.431: %ptr.as.Destroy.impl.Op.type.c2a = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.df1: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.cc2: %AggregateT.as_type.as.Destroy.impl.Op.type.df1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -375,8 +381,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %s.var: ref %S = var %s.var_patt
|
||||
// CHECK:STDOUT: %.loc8_19.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc8_19.2: init %S = class_init (), %s.var [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc8_3: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_3
|
||||
// CHECK:STDOUT: %.loc8_3.1: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_3.1
|
||||
// CHECK:STDOUT: %.loc8_13: type = splice_block %S.ref.loc8 [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc8: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
@@ -406,16 +412,18 @@ fn F() {
|
||||
// CHECK:STDOUT: %p.ref: ref %ptr.5c7 = name_ref p, %p
|
||||
// CHECK:STDOUT: %addr.loc10: %ptr.dfe = addr_of %p.ref
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%addr.loc10)
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %p.var, constants.%T.as.Destroy.impl.Op.76a
|
||||
// CHECK:STDOUT: %ptr.as.Destroy.impl.Op.bound: <bound method> = bound_method %p.var, constants.%ptr.as.Destroy.impl.Op.431
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method.loc9_3: <bound method> = bound_method %p.var, %T.as.Destroy.impl.Op.specific_fn.1
|
||||
// CHECK:STDOUT: %bound_method.loc9_3: <bound method> = bound_method %p.var, %ptr.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %addr.loc9_3: %ptr.dfe = addr_of %p.var
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9_3(%addr.loc9_3)
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %s.var, constants.%T.as.Destroy.impl.Op.062
|
||||
// CHECK:STDOUT: %ptr.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc9_3(%addr.loc9_3)
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%S, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%S, %facet_value [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.cc2
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %s.var, %T.as.Destroy.impl.Op.specific_fn.2
|
||||
// CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %s.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %s.var
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8)
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -423,18 +431,26 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %S: type = class_type @S [concrete]
|
||||
// CHECK:STDOUT: %const: type = const_type %S [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9be: type = pattern_type %const [concrete]
|
||||
// CHECK:STDOUT: %const.e39: type = const_type %S [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9be: type = pattern_type %const.e39 [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @F [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.ff5: type = ptr_type %const [concrete]
|
||||
// CHECK:STDOUT: %ptr.ff5: type = ptr_type %const.e39 [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.4ce: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%const) [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.7f5: %T.as.Destroy.impl.Op.type.4ce = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
|
||||
// CHECK:STDOUT: %AggregateT: %type_where = bind_symbolic_name AggregateT, 0 [symbolic]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.190: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%AggregateT) [symbolic]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.8a0: %AggregateT.as_type.as.Destroy.impl.Op.type.190 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.impl_witness.c8b: <witness> = impl_witness imports.%Destroy.impl_witness_table.2d3, @AggregateT.as_type.as.Destroy.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.facet.7eb: %Destroy.type = facet_value %S, (%Destroy.impl_witness.c8b) [concrete]
|
||||
// CHECK:STDOUT: %const.as.Destroy.impl.Op.type.21f: type = fn_type @const.as.Destroy.impl.Op, @const.as.Destroy.impl(%Destroy.facet.7eb) [concrete]
|
||||
// CHECK:STDOUT: %const.as.Destroy.impl.Op.a1c: %const.as.Destroy.impl.Op.type.21f = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -450,6 +466,8 @@ fn F() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import_ref.d51: @AggregateT.as_type.as.Destroy.impl.%AggregateT.as_type.as.Destroy.impl.Op.type (%AggregateT.as_type.as.Destroy.impl.Op.type.190) = import_ref Core//prelude/parts/destroy, loc29_29, loaded [symbolic = @AggregateT.as_type.as.Destroy.impl.%AggregateT.as_type.as.Destroy.impl.Op (constants.%AggregateT.as_type.as.Destroy.impl.Op.8a0)]
|
||||
// CHECK:STDOUT: %Destroy.impl_witness_table.2d3 = impl_witness_table (%Core.import_ref.d51), @AggregateT.as_type.as.Destroy.impl [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
@@ -458,27 +476,31 @@ fn F() {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.9be = binding_pattern s [concrete]
|
||||
// CHECK:STDOUT: %s.var_patt: %pattern_type.9be = var_pattern %s.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %s.var: ref %const = var %s.var_patt
|
||||
// CHECK:STDOUT: %s.var: ref %const.e39 = var %s.var_patt
|
||||
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
||||
// CHECK:STDOUT: %.loc10_3: ref %const = splice_block %s.var {}
|
||||
// CHECK:STDOUT: %G.call: init %const = call %G.ref() to %.loc10_3
|
||||
// CHECK:STDOUT: %.loc10_3.1: ref %const.e39 = splice_block %s.var {}
|
||||
// CHECK:STDOUT: %G.call: init %const.e39 = call %G.ref() to %.loc10_3.1
|
||||
// CHECK:STDOUT: assign %s.var, %G.call
|
||||
// CHECK:STDOUT: %.loc10_10: type = splice_block %const [concrete = constants.%const] {
|
||||
// CHECK:STDOUT: %.loc10_10: type = splice_block %const [concrete = constants.%const.e39] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const: type = const_type %S.ref [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %const: type = const_type %S.ref [concrete = constants.%const.e39]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %s: ref %const = bind_name s, %s.var
|
||||
// CHECK:STDOUT: %s: ref %const.e39 = bind_name s, %s.var
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %s.ref: ref %const = name_ref s, %s
|
||||
// CHECK:STDOUT: %s.ref: ref %const.e39 = name_ref s, %s
|
||||
// CHECK:STDOUT: %addr.loc11: %ptr.ff5 = addr_of %s.ref
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%addr.loc11)
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%T.as.Destroy.impl.Op.7f5
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%S, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc10_3.2: %type_where = converted constants.%S, %facet_value [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value constants.%S, (constants.%Destroy.impl_witness.c8b) [concrete = constants.%Destroy.facet.7eb]
|
||||
// CHECK:STDOUT: %.loc10_3.3: %Destroy.type = converted constants.%S, %Destroy.facet [concrete = constants.%Destroy.facet.7eb]
|
||||
// CHECK:STDOUT: %const.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%const.as.Destroy.impl.Op.a1c
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %T.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %const.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %addr.loc10: %ptr.ff5 = addr_of %s.var
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc10)
|
||||
// CHECK:STDOUT: %const.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc10)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -627,8 +649,10 @@ fn F() {
|
||||
// CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @Destroy.Op [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.d46: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%S) [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.062: %T.as.Destroy.impl.Op.type.d46 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.df1: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.cc2: %AggregateT.as_type.as.Destroy.impl.Op.type.df1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -650,8 +674,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %s.var: ref %S = var %s.var_patt
|
||||
// CHECK:STDOUT: %.loc8_19.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc8_19.2: init %S = class_init (), %s.var [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc8_3: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_3
|
||||
// CHECK:STDOUT: %.loc8_3.1: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_3.1
|
||||
// CHECK:STDOUT: %.loc8_13: type = splice_block %S.ref [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
@@ -661,11 +685,13 @@ fn F() {
|
||||
// CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %addr.loc16: %ptr.5c7 = addr_of %s.ref
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%T.as.Destroy.impl.Op.062
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%S, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%S, %facet_value [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.cc2
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %T.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %s.var
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8)
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -683,8 +709,10 @@ fn F() {
|
||||
// CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.d46: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%S) [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.062: %T.as.Destroy.impl.Op.type.d46 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.df1: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.cc2: %AggregateT.as_type.as.Destroy.impl.Op.type.df1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -711,8 +739,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %s.var: ref %S = var %s.var_patt
|
||||
// CHECK:STDOUT: %.loc8_19.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc8_19.2: init %S = class_init (), %s.var [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc8_3: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_3
|
||||
// CHECK:STDOUT: %.loc8_3.1: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_3.1
|
||||
// CHECK:STDOUT: %.loc8_13: type = splice_block %S.ref.loc8 [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc8: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
@@ -734,11 +762,13 @@ fn F() {
|
||||
// CHECK:STDOUT: %.loc9_29.1: %ptr.5c7 = value_of_initializer %foo.call
|
||||
// CHECK:STDOUT: %.loc9_29.2: %ptr.5c7 = converted %foo.call, %.loc9_29.1
|
||||
// CHECK:STDOUT: %p: %ptr.5c7 = bind_name p, %.loc9_29.2
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%T.as.Destroy.impl.Op.062
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%S, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%S, %facet_value [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.cc2
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %T.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %s.var
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8)
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -753,12 +783,14 @@ fn F() {
|
||||
// CHECK:STDOUT: %.97c: type = cpp_overload_set_type @Destroy.Op [concrete]
|
||||
// CHECK:STDOUT: %empty_struct.504: %.97c = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
|
||||
// CHECK:STDOUT: %.fed: type = cpp_overload_set_type @T.as.Destroy.impl.Op [concrete]
|
||||
// CHECK:STDOUT: %.fed: type = cpp_overload_set_type @ptr.as.Destroy.impl.Op [concrete]
|
||||
// CHECK:STDOUT: %empty_struct.6e8: %.fed = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Indirect.type: type = fn_type @Indirect [concrete]
|
||||
// CHECK:STDOUT: %Indirect: %Indirect.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.d46: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%S) [concrete]
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.062: %T.as.Destroy.impl.Op.type.d46 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.df1: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.cc2: %AggregateT.as_type.as.Destroy.impl.Op.type.df1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -770,7 +802,7 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
|
||||
// CHECK:STDOUT: %.e4a: %.97c = cpp_overload_set_value @Destroy.Op [concrete = constants.%empty_struct.504]
|
||||
// CHECK:STDOUT: %.9c4: %.fed = cpp_overload_set_value @T.as.Destroy.impl.Op [concrete = constants.%empty_struct.6e8]
|
||||
// CHECK:STDOUT: %.9c4: %.fed = cpp_overload_set_value @ptr.as.Destroy.impl.Op [concrete = constants.%empty_struct.6e8]
|
||||
// CHECK:STDOUT: %Indirect.decl: %Indirect.type = fn_decl @Indirect [concrete = constants.%Indirect] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -787,8 +819,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %s.var: ref %S = var %s.var_patt
|
||||
// CHECK:STDOUT: %.loc8_19.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc8_19.2: init %S = class_init (), %s.var [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc8_3: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_3
|
||||
// CHECK:STDOUT: %.loc8_3.1: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_3.1
|
||||
// CHECK:STDOUT: %.loc8_13: type = splice_block %S.ref.loc8 [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc8: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
@@ -809,16 +841,20 @@ fn F() {
|
||||
// CHECK:STDOUT: %.loc25_19.1: ref %S = converted %.loc25_17.1, %.loc25_17.4
|
||||
// CHECK:STDOUT: %.loc25_19.2: %S = bind_value %.loc25_19.1
|
||||
// CHECK:STDOUT: %Indirect.call: init <error> = call imports.%Indirect.decl(%.loc25_19.2)
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc25: <bound method> = bound_method %.loc25_17.4, constants.%T.as.Destroy.impl.Op.062
|
||||
// CHECK:STDOUT: %facet_value.loc25: %type_where = facet_value constants.%S, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc25_17.5: %type_where = converted constants.%S, %facet_value.loc25 [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound.loc25: <bound method> = bound_method %.loc25_17.4, constants.%AggregateT.as_type.as.Destroy.impl.Op.cc2
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method.loc25: <bound method> = bound_method %.loc25_17.4, %T.as.Destroy.impl.Op.specific_fn.1
|
||||
// CHECK:STDOUT: %bound_method.loc25: <bound method> = bound_method %.loc25_17.4, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
|
||||
// CHECK:STDOUT: %addr.loc25: %ptr.5c7 = addr_of %.loc25_17.4
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25(%addr.loc25)
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %s.var, constants.%T.as.Destroy.impl.Op.062
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25(%addr.loc25)
|
||||
// CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%S, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%S, %facet_value.loc8 [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %s.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.cc2
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %s.var, %T.as.Destroy.impl.Op.specific_fn.2
|
||||
// CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %s.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
|
||||
// CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %s.var
|
||||
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8)
|
||||
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user