Mangle the signature decl when mangling a thunk. (#7177)

Fixes mangling collisions when two thunks with the same name (eg, `Op`)
are created in the same context, which in turn would lead to LLVM
verifier failures and miscompiles.

To support this, add a new value store to track a little more
information about thunks beyond what's in the `Function`.
This commit is contained in:
Richard Smith
2026-05-07 21:58:29 +00:00
committed by GitHub
parent 031ec0a140
commit bc06f6c5ec
40 changed files with 637 additions and 341 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ fn InstanceCall(n: i32) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @i32.as.Simple.impl.G.loc24_27.1(%self.param: <error>);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @i32.as.Simple.impl.G.loc24_27.2(%self.param: %i32) [thunk @i32.as.Simple.impl.%i32.as.Simple.impl.G.decl.loc24_27.1] {
// CHECK:STDOUT: fn @i32.as.Simple.impl.G.loc24_27.2(%self.param: %i32) [thunk @i32.as.Simple.impl.%i32.as.Simple.impl.G.decl.loc24_27.1 for @Simple.WithSelf.%Simple.WithSelf.G.decl, @Simple.WithSelf.G(constants.%Simple.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %G.ref: %i32.as.Simple.impl.G.type.32ad7a.1 = name_ref G, @i32.as.Simple.impl.%i32.as.Simple.impl.G.decl.loc24_27.1 [concrete = constants.%i32.as.Simple.impl.G.4f6260.1]
// CHECK:STDOUT: %i32.as.Simple.impl.G.bound: <bound method> = bound_method %self.param, %G.ref
+10 -10
View File
@@ -1208,7 +1208,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FExtraParam.as.I.impl.F.loc69_18.1(%b.param: bool);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FExtraParam.as.I.impl.F.loc69_18.2() [thunk @FExtraParam.as.I.impl.%FExtraParam.as.I.impl.F.decl.loc69_18.1] {
// CHECK:STDOUT: fn @FExtraParam.as.I.impl.F.loc69_18.2() [thunk @FExtraParam.as.I.impl.%FExtraParam.as.I.impl.F.decl.loc69_18.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.b53)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %FExtraParam.as.I.impl.F.type.531438.1 = name_ref F, @FExtraParam.as.I.impl.%FExtraParam.as.I.impl.F.decl.loc69_18.1 [concrete = constants.%FExtraParam.as.I.impl.F.33e1fe.1]
// CHECK:STDOUT: return
@@ -1216,7 +1216,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc85_23.1(%self.param: %FExtraImplicitParam);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc85_23.2() [thunk @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc85_23.1] {
// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc85_23.2() [thunk @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc85_23.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.5a5)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %FExtraImplicitParam.as.I.impl.F.type.9dd145.1 = name_ref F, @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc85_23.1 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.99eae8.1]
// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.call: init %empty_tuple.type = call %F.ref(<error>)
@@ -1231,7 +1231,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc117_31.1(%self.param: bool) -> out %return.param: bool;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc117_31.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc117_31.1] {
// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc117_31.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc117_31.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.567)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %FMissingParam.as.J.impl.F.type.0f71d8.1 = name_ref F, @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc117_31.1 [concrete = constants.%FMissingParam.as.J.impl.F.7540f6.1]
// CHECK:STDOUT: %FMissingParam.as.J.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -1240,7 +1240,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FMissingImplicitParam.as.J.impl.F.loc130_26.1(%b.param: bool) -> out %return.param: bool;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FMissingImplicitParam.as.J.impl.F.loc130_26.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingImplicitParam.as.J.impl.%FMissingImplicitParam.as.J.impl.F.decl.loc130_26.1] {
// CHECK:STDOUT: fn @FMissingImplicitParam.as.J.impl.F.loc130_26.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingImplicitParam.as.J.impl.%FMissingImplicitParam.as.J.impl.F.decl.loc130_26.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.266)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %FMissingImplicitParam.as.J.impl.F.type.80a56b.1 = name_ref F, @FMissingImplicitParam.as.J.impl.%FMissingImplicitParam.as.J.impl.F.decl.loc130_26.1 [concrete = constants.%FMissingImplicitParam.as.J.impl.F.c6a0b7.1]
// CHECK:STDOUT: %FMissingImplicitParam.as.J.impl.F.call: init bool = call %F.ref(%b.param)
@@ -1249,7 +1249,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc152_30.1(%self.param: bool, %b.param: bool);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc152_30.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc152_30.1] {
// CHECK:STDOUT: fn @FMissingReturnType.as.J.impl.F.loc152_30.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc152_30.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.a9e)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %FMissingReturnType.as.J.impl.F.type.ce0d21.1 = name_ref F, @FMissingReturnType.as.J.impl.%FMissingReturnType.as.J.impl.F.decl.loc152_30.1 [concrete = constants.%FMissingReturnType.as.J.impl.F.5b613a.1]
// CHECK:STDOUT: %FMissingReturnType.as.J.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -1260,7 +1260,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc171_38.1(%self.param: bool, %b.param: %FDifferentParamType) -> out %return.param: bool;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc171_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc171_38.1] {
// CHECK:STDOUT: fn @FDifferentParamType.as.J.impl.F.loc171_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc171_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.bd2)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %FDifferentParamType.as.J.impl.F.type.10926d.1 = name_ref F, @FDifferentParamType.as.J.impl.%FDifferentParamType.as.J.impl.F.decl.loc171_38.1 [concrete = constants.%FDifferentParamType.as.J.impl.F.f1245a.1]
// CHECK:STDOUT: %FDifferentParamType.as.J.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -1271,7 +1271,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc184_38.1(%self.param: %FDifferentImplicitParamType, %b.param: bool) -> out %return.param: bool;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc184_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.1] {
// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc184_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.030)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %FDifferentImplicitParamType.as.J.impl.F.type.955391.1 = name_ref F, @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.1 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.a9ece4.1]
// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -1282,7 +1282,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc200_38.1(%self.param: bool, %b.param: bool) -> out %return.param: %FDifferentReturnType;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc200_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc200_38.1] {
// CHECK:STDOUT: fn @FDifferentReturnType.as.J.impl.F.loc200_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc200_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.4a1)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %FDifferentReturnType.as.J.impl.F.type.7bcb67.1 = name_ref F, @FDifferentReturnType.as.J.impl.%FDifferentReturnType.as.J.impl.F.decl.loc200_38.1 [concrete = constants.%FDifferentReturnType.as.J.impl.F.a709b1.1]
// CHECK:STDOUT: %FDifferentReturnType.as.J.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -1309,7 +1309,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @SelfNestedBadParam.as.SelfNested.impl.F.loc223_87.1(%x.param: %tuple.type.70f) -> out %return.param: %array_type.388;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @SelfNestedBadParam.as.SelfNested.impl.F.loc223_87.2(%x.param: %tuple.type.7ea) -> out %return.param: %array_type.388 [thunk @SelfNestedBadParam.as.SelfNested.impl.%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc223_87.1] {
// CHECK:STDOUT: fn @SelfNestedBadParam.as.SelfNested.impl.F.loc223_87.2(%x.param: %tuple.type.7ea) -> out %return.param: %array_type.388 [thunk @SelfNestedBadParam.as.SelfNested.impl.%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc223_87.1 for @SelfNested.WithSelf.%SelfNested.WithSelf.F.decl, @SelfNested.WithSelf.F(constants.%SelfNested.facet.b9f)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %SelfNestedBadParam.as.SelfNested.impl.F.type.789632.1 = name_ref F, @SelfNestedBadParam.as.SelfNested.impl.%SelfNestedBadParam.as.SelfNested.impl.F.decl.loc223_87.1 [concrete = constants.%SelfNestedBadParam.as.SelfNested.impl.F.6e1661.1]
// CHECK:STDOUT: %.loc211_57: ref %array_type.388 = splice_block %return.param {}
@@ -1323,7 +1323,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @SelfNestedBadReturnType.as.SelfNested.impl.F.loc239_112.1(%x.param: %tuple.type.064) -> out %return.param: %array_type.388;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @SelfNestedBadReturnType.as.SelfNested.impl.F.loc239_112.2(%x.param: %tuple.type.064) -> out %return.param: %array_type.31b [thunk @SelfNestedBadReturnType.as.SelfNested.impl.%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc239_112.1] {
// CHECK:STDOUT: fn @SelfNestedBadReturnType.as.SelfNested.impl.F.loc239_112.2(%x.param: %tuple.type.064) -> out %return.param: %array_type.31b [thunk @SelfNestedBadReturnType.as.SelfNested.impl.%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc239_112.1 for @SelfNested.WithSelf.%SelfNested.WithSelf.F.decl, @SelfNested.WithSelf.F(constants.%SelfNested.facet.23f)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %SelfNestedBadReturnType.as.SelfNested.impl.F.type.75d128.1 = name_ref F, @SelfNestedBadReturnType.as.SelfNested.impl.%SelfNestedBadReturnType.as.SelfNested.impl.F.decl.loc239_112.1 [concrete = constants.%SelfNestedBadReturnType.as.SelfNested.impl.F.587f77.1]
// CHECK:STDOUT: %.loc239_112.1: ref %array_type.388 = temporary_storage
@@ -255,7 +255,7 @@ impl i32 as I {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @i32.as.I.impl.F.loc43_18.1(%c.param: %C.899);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @i32.as.I.impl.F.loc43_18.2(%c.param: %C.719) [thunk @i32.as.I.impl.%i32.as.I.impl.F.decl.loc43_18.1] {
// CHECK:STDOUT: fn @i32.as.I.impl.F.loc43_18.2(%c.param: %C.719) [thunk @i32.as.I.impl.%i32.as.I.impl.F.decl.loc43_18.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.20f)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %i32.as.I.impl.F.type.6c53e7.1 = name_ref F, @i32.as.I.impl.%i32.as.I.impl.F.decl.loc43_18.1 [concrete = constants.%i32.as.I.impl.F.7f652f.1]
// CHECK:STDOUT: %.loc25: %C.899 = converted %c.param, <error> [concrete = <error>]
+41 -10
View File
@@ -343,12 +343,14 @@ impl () as I({}) {
// CHECK:STDOUT: --- struct_conversion.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
// CHECK:STDOUT: %struct_type.a.b.391: type = struct_type {.a: %empty_tuple.type, .b: %empty_struct_type} [concrete]
// CHECK:STDOUT: %struct_type.c.d.15a: type = struct_type {.c: %empty_tuple.type, .d: %empty_struct_type} [concrete]
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete]
// CHECK:STDOUT: %struct_type.b.a.40c: type = struct_type {.b: %empty_struct_type, .a: %empty_tuple.type} [concrete]
// CHECK:STDOUT: %pattern_type.231: type = pattern_type %struct_type.b.a.40c [concrete]
// CHECK:STDOUT: %struct_type.d.c.b36: type = struct_type {.d: %empty_struct_type, .c: %empty_tuple.type} [concrete]
@@ -356,6 +358,7 @@ impl () as I({}) {
// CHECK:STDOUT: %pattern_type.844: type = pattern_type %struct_type.d.c.b36 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.1: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_48.1 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.8be29b.1: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = struct_value () [concrete]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_tuple.type, (%I.impl_witness) [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.2: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_48.2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.8be29b.2: %empty_tuple.type.as.I.impl.F.type.19e4b8.2 = struct_value () [concrete]
// CHECK:STDOUT: %struct: %struct_type.c.d.15a = struct_value (%empty_tuple, %empty_struct) [concrete]
@@ -403,7 +406,7 @@ impl () as I({}) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.F.loc10_48.1(%y.param: %struct_type.b.a.40c) -> out %return.param: %struct_type.d.c.b36;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.F.loc10_48.2(%x.param: %struct_type.a.b.391) -> out %return.param: %struct_type.c.d.15a [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_48.1] {
// CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.F.loc10_48.2(%x.param: %struct_type.a.b.391) -> out %return.param: %struct_type.c.d.15a [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_48.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = name_ref F, @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_48.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1]
// CHECK:STDOUT: %.loc10_48.1: ref %struct_type.d.c.b36 = temporary_storage
@@ -442,6 +445,8 @@ impl () as I({}) {
// CHECK:STDOUT: %A: type = class_type @A [concrete]
// CHECK:STDOUT: %B: type = class_type @B [concrete]
// CHECK:STDOUT: %C: type = class_type @C [concrete]
// CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
// CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness @B.as.X.impl.%X.impl_witness_table [concrete]
// CHECK:STDOUT: %pattern_type.1ab: type = pattern_type %A [concrete]
// CHECK:STDOUT: %ptr.643: type = ptr_type %A [concrete]
// CHECK:STDOUT: %pattern_type.f29: type = pattern_type %ptr.643 [concrete]
@@ -450,6 +455,7 @@ impl () as I({}) {
// CHECK:STDOUT: %pattern_type.506: type = pattern_type %ptr.31e [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.type.421a66.1: type = fn_type @B.as.X.impl.F.loc14_37.1 [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.8ec460.1: %B.as.X.impl.F.type.421a66.1 = struct_value () [concrete]
// CHECK:STDOUT: %X.facet: %X.type = facet_value %B, (%X.impl_witness) [concrete]
// CHECK:STDOUT: %ptr.27c: type = ptr_type %B [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.type.421a66.2: type = fn_type @B.as.X.impl.F.loc14_37.2 [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.8ec460.2: %B.as.X.impl.F.type.421a66.2 = struct_value () [concrete]
@@ -512,7 +518,7 @@ impl () as I({}) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.1(%self.param: ref %A, %other.param: %ptr.643) -> out %return.param: %ptr.31e;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.2(%self.param: ref %B, %other.param: %ptr.27c) -> out %return.param: %ptr.27c [thunk @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1] {
// CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.2(%self.param: ref %B, %other.param: %ptr.27c) -> out %return.param: %ptr.27c [thunk @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 for @X.WithSelf.%X.WithSelf.F.decl, @X.WithSelf.F(constants.%X.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.421a66.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 [concrete = constants.%B.as.X.impl.F.8ec460.1]
// CHECK:STDOUT: %B.as.X.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -538,9 +544,12 @@ impl () as I({}) {
// CHECK:STDOUT: %A: type = class_type @A [concrete]
// CHECK:STDOUT: %B: type = class_type @B [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
// CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness @B.as.X.impl.%X.impl_witness_table [concrete]
// CHECK:STDOUT: %pattern_type.1ab: type = pattern_type %A [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.type.421a66.1: type = fn_type @B.as.X.impl.F.loc13_26.1 [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.8ec460.1: %B.as.X.impl.F.type.421a66.1 = struct_value () [concrete]
// CHECK:STDOUT: %X.facet: %X.type = facet_value %B, (%X.impl_witness) [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.type.421a66.2: type = fn_type @B.as.X.impl.F.loc13_26.2 [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.8ec460.2: %B.as.X.impl.F.type.421a66.2 = struct_value () [concrete]
// CHECK:STDOUT: }
@@ -574,7 +583,7 @@ impl () as I({}) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B.as.X.impl.F.loc13_26.1(%self.param: %A, %other.param: %A);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B.as.X.impl.F.loc13_26.2(%self.param: %B, %other.param: %B) [thunk @B.as.X.impl.%B.as.X.impl.F.decl.loc13_26.1] {
// CHECK:STDOUT: fn @B.as.X.impl.F.loc13_26.2(%self.param: %B, %other.param: %B) [thunk @B.as.X.impl.%B.as.X.impl.F.decl.loc13_26.1 for @X.WithSelf.%X.WithSelf.F.decl, @X.WithSelf.F(constants.%X.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.421a66.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc13_26.1 [concrete = constants.%B.as.X.impl.F.8ec460.1]
// CHECK:STDOUT: %B.as.X.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -589,6 +598,8 @@ impl () as I({}) {
// CHECK:STDOUT: %A: type = class_type @A [concrete]
// CHECK:STDOUT: %B: type = class_type @B [concrete]
// CHECK:STDOUT: %C: type = class_type @C [concrete]
// CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
// CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness @B.as.X.impl.%X.impl_witness_table [concrete]
// CHECK:STDOUT: %pattern_type.1ab: type = pattern_type %A [concrete]
// CHECK:STDOUT: %ptr.643: type = ptr_type %A [concrete]
// CHECK:STDOUT: %pattern_type.f29: type = pattern_type %ptr.643 [concrete]
@@ -597,6 +608,7 @@ impl () as I({}) {
// CHECK:STDOUT: %pattern_type.506: type = pattern_type %ptr.31e [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.type.421a66.1: type = fn_type @B.as.X.impl.F.loc14_37.1 [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.8ec460.1: %B.as.X.impl.F.type.421a66.1 = struct_value () [concrete]
// CHECK:STDOUT: %X.facet: %X.type = facet_value %B, (%X.impl_witness) [concrete]
// CHECK:STDOUT: %ptr.27c: type = ptr_type %B [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.type.421a66.2: type = fn_type @B.as.X.impl.F.loc14_37.2 [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.8ec460.2: %B.as.X.impl.F.type.421a66.2 = struct_value () [concrete]
@@ -659,7 +671,7 @@ impl () as I({}) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.1(%self.param: ref %A, %other.param: %ptr.643) -> out %return.param: %ptr.31e;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.2(%self.param: ref %B, %other.param: %ptr.27c) -> out %return.param: %ptr.27c [thunk @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1] {
// CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.2(%self.param: ref %B, %other.param: %ptr.27c) -> out %return.param: %ptr.27c [thunk @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 for @X.WithSelf.%X.WithSelf.F.decl, @X.WithSelf.F(constants.%X.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.421a66.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 [concrete = constants.%B.as.X.impl.F.8ec460.1]
// CHECK:STDOUT: %B.as.X.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -685,6 +697,8 @@ impl () as I({}) {
// CHECK:STDOUT: %A: type = class_type @A [concrete]
// CHECK:STDOUT: %B: type = class_type @B [concrete]
// CHECK:STDOUT: %C: type = class_type @C [concrete]
// CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
// CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness @B.as.X.impl.%X.impl_witness_table [concrete]
// CHECK:STDOUT: %pattern_type.1ab: type = pattern_type %A [concrete]
// CHECK:STDOUT: %ptr.643: type = ptr_type %A [concrete]
// CHECK:STDOUT: %pattern_type.f29: type = pattern_type %ptr.643 [concrete]
@@ -693,6 +707,7 @@ impl () as I({}) {
// CHECK:STDOUT: %pattern_type.506: type = pattern_type %ptr.31e [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.type.421a66.1: type = fn_type @B.as.X.impl.F.loc14_37.1 [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.8ec460.1: %B.as.X.impl.F.type.421a66.1 = struct_value () [concrete]
// CHECK:STDOUT: %X.facet: %X.type = facet_value %B, (%X.impl_witness) [concrete]
// CHECK:STDOUT: %ptr.27c: type = ptr_type %B [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.type.421a66.2: type = fn_type @B.as.X.impl.F.loc14_37.2 [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.8ec460.2: %B.as.X.impl.F.type.421a66.2 = struct_value () [concrete]
@@ -755,7 +770,7 @@ impl () as I({}) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.1(%self.param: ref %A, %other.param: %ptr.643) -> out %return.param: %ptr.31e;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.2(%self.param: ref %B, %other.param: %ptr.27c) -> out %return.param: %ptr.27c [thunk @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1] {
// CHECK:STDOUT: fn @B.as.X.impl.F.loc14_37.2(%self.param: ref %B, %other.param: %ptr.27c) -> out %return.param: %ptr.27c [thunk @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 for @X.WithSelf.%X.WithSelf.F.decl, @X.WithSelf.F(constants.%X.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.421a66.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 [concrete = constants.%B.as.X.impl.F.8ec460.1]
// CHECK:STDOUT: %B.as.X.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -781,9 +796,12 @@ impl () as I({}) {
// CHECK:STDOUT: %A: type = class_type @A [concrete]
// CHECK:STDOUT: %B: type = class_type @B [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
// CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness @B.as.X.impl.%X.impl_witness_table [concrete]
// CHECK:STDOUT: %pattern_type.1ab: type = pattern_type %A [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.type.421a66.1: type = fn_type @B.as.X.impl.F.loc13_30.1 [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.8ec460.1: %B.as.X.impl.F.type.421a66.1 = struct_value () [concrete]
// CHECK:STDOUT: %X.facet: %X.type = facet_value %B, (%X.impl_witness) [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.type.421a66.2: type = fn_type @B.as.X.impl.F.loc13_30.2 [concrete]
// CHECK:STDOUT: %B.as.X.impl.F.8ec460.2: %B.as.X.impl.F.type.421a66.2 = struct_value () [concrete]
// CHECK:STDOUT: }
@@ -817,7 +835,7 @@ impl () as I({}) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B.as.X.impl.F.loc13_30.1(%self.param: %A, %other.param: ref %A);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B.as.X.impl.F.loc13_30.2(%self.param: %B, %other.param: ref %B) [thunk @B.as.X.impl.%B.as.X.impl.F.decl.loc13_30.1] {
// CHECK:STDOUT: fn @B.as.X.impl.F.loc13_30.2(%self.param: %B, %other.param: ref %B) [thunk @B.as.X.impl.%B.as.X.impl.F.decl.loc13_30.1 for @X.WithSelf.%X.WithSelf.F.decl, @X.WithSelf.F(constants.%X.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.421a66.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc13_30.1 [concrete = constants.%B.as.X.impl.F.8ec460.1]
// CHECK:STDOUT: %B.as.X.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -834,10 +852,13 @@ impl () as I({}) {
// CHECK:STDOUT: %B: type = class_type @B [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %struct_type.base.5af: type = struct_type {.base: %A} [concrete]
// CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
// CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness @A.as.X.impl.%X.impl_witness_table [concrete]
// CHECK:STDOUT: %.7df: Core.Form = init_form %B [concrete]
// CHECK:STDOUT: %pattern_type.1f4: type = pattern_type %B [concrete]
// CHECK:STDOUT: %A.as.X.impl.F.type.170a02.1: type = fn_type @A.as.X.impl.F.loc23_14.1 [concrete]
// CHECK:STDOUT: %A.as.X.impl.F.e6cf46.1: %A.as.X.impl.F.type.170a02.1 = struct_value () [concrete]
// CHECK:STDOUT: %X.facet: %X.type = facet_value %A, (%X.impl_witness) [concrete]
// CHECK:STDOUT: %A.as.X.impl.F.type.170a02.2: type = fn_type @A.as.X.impl.F.loc23_14.2 [concrete]
// CHECK:STDOUT: %A.as.X.impl.F.e6cf46.2: %A.as.X.impl.F.type.170a02.2 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc23_14.4 [concrete]
@@ -870,7 +891,7 @@ impl () as I({}) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A.as.X.impl.F.loc23_14.1() -> out %return.param: %B;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A.as.X.impl.F.loc23_14.2() -> out %return.param: %A [thunk @A.as.X.impl.%A.as.X.impl.F.decl.loc23_14.1] {
// CHECK:STDOUT: fn @A.as.X.impl.F.loc23_14.2() -> out %return.param: %A [thunk @A.as.X.impl.%A.as.X.impl.F.decl.loc23_14.1 for @X.WithSelf.%X.WithSelf.F.decl, @X.WithSelf.F(constants.%X.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %A.as.X.impl.F.type.170a02.1 = name_ref F, @A.as.X.impl.%A.as.X.impl.F.decl.loc23_14.1 [concrete = constants.%A.as.X.impl.F.e6cf46.1]
// CHECK:STDOUT: %.loc23_14.1: ref %B = temporary_storage
@@ -904,8 +925,11 @@ impl () as I({}) {
// CHECK:STDOUT: --- generic_function.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete]
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
// CHECK:STDOUT: %pattern_type.ce2: type = pattern_type %Copy.type [concrete]
// CHECK:STDOUT: %U.035: %Copy.type = symbolic_binding U, 0 [symbolic]
@@ -914,6 +938,7 @@ impl () as I({}) {
// CHECK:STDOUT: %.435d17.2: Core.Form = init_form %U.as_type.255 [symbolic]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.1: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_34.1 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.8be29b.1: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = struct_value () [concrete]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_tuple.type, (%I.impl_witness) [concrete]
// CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %ptr.e8f: type = ptr_type %T.67d [symbolic]
// CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr.e8f [symbolic]
@@ -1024,7 +1049,7 @@ impl () as I({}) {
// CHECK:STDOUT: %Copy.facet.loc10_34.2: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_34.2 (constants.%Copy.facet)]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_34.2: <specific function> = specific_function constants.%empty_tuple.type.as.I.impl.F.8be29b.1, @empty_tuple.type.as.I.impl.F.loc10_34.1(%Copy.facet.loc10_34.2) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_34.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%x.param: @empty_tuple.type.as.I.impl.F.loc10_34.2.%ptr (%ptr.e8f)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_34.2.%ptr (%ptr.e8f) [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_34.1] {
// CHECK:STDOUT: fn(%x.param: @empty_tuple.type.as.I.impl.F.loc10_34.2.%ptr (%ptr.e8f)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_34.2.%ptr (%ptr.e8f) [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_34.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet, constants.%T.67d)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = name_ref F, @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_34.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1]
// CHECK:STDOUT: %Copy.facet.loc10_34.1: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.2e6) [symbolic = %Copy.facet.loc10_34.2 (constants.%Copy.facet)]
@@ -1067,10 +1092,12 @@ impl () as I({}) {
// CHECK:STDOUT: --- generic_method.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete]
// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
// CHECK:STDOUT: %pattern_type.ce2: type = pattern_type %Copy.type [concrete]
@@ -1080,6 +1107,7 @@ impl () as I({}) {
// CHECK:STDOUT: %.435d17.2: Core.Form = init_form %U.as_type.255 [symbolic]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.1: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_51.1 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.8be29b.1: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = struct_value () [concrete]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_tuple.type, (%I.impl_witness) [concrete]
// CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %ptr.e8f: type = ptr_type %T.67d [symbolic]
// CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr.e8f [symbolic]
@@ -1198,7 +1226,7 @@ impl () as I({}) {
// CHECK:STDOUT: %Copy.facet.loc10_51.2: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_51.2 (constants.%Copy.facet)]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.2: <specific function> = specific_function constants.%empty_tuple.type.as.I.impl.F.8be29b.1, @empty_tuple.type.as.I.impl.F.loc10_51.1(%Copy.facet.loc10_51.2) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_51.2.%ptr (%ptr.e8f)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_51.2.%ptr (%ptr.e8f) [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_51.1] {
// CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_51.2.%ptr (%ptr.e8f)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_51.2.%ptr (%ptr.e8f) [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_51.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet, constants.%T.67d)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = name_ref F, @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_51.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -1246,11 +1274,14 @@ impl () as I({}) {
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
// CHECK:STDOUT: %I.type.ab5: type = facet_type <@I, @I(%empty_struct_type)> [concrete]
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete]
// CHECK:STDOUT: %struct_type.b.a.1b0: type = struct_type {.b: %empty_struct_type, .a: %empty_struct_type} [concrete]
// CHECK:STDOUT: %.3fc: Core.Form = init_form %struct_type.b.a.1b0 [concrete]
// CHECK:STDOUT: %pattern_type.914: type = pattern_type %struct_type.b.a.1b0 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.e82c13.1: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_29.1 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.5f0cef.1: %empty_tuple.type.as.I.impl.F.type.e82c13.1 = struct_value () [concrete]
// CHECK:STDOUT: %I.facet: %I.type.ab5 = facet_value %empty_tuple.type, (%I.impl_witness) [concrete]
// CHECK:STDOUT: %struct_type.a.b.f95: type = struct_type {.a: %empty_struct_type, .b: %empty_struct_type} [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.e82c13.2: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_29.2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.5f0cef.2: %empty_tuple.type.as.I.impl.F.type.e82c13.2 = struct_value () [concrete]
@@ -1288,7 +1319,7 @@ impl () as I({}) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.F.loc10_29.1() -> out %return.param: %struct_type.b.a.1b0;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.F.loc10_29.2() -> out %return.param: %struct_type.a.b.f95 [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_29.1] {
// CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.F.loc10_29.2() -> out %return.param: %struct_type.a.b.f95 [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_29.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%empty_struct_type, constants.%I.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.I.impl.F.type.e82c13.1 = name_ref F, @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_29.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.5f0cef.1]
// CHECK:STDOUT: %.loc10_29.1: ref %struct_type.b.a.1b0 = temporary_storage
+21 -16
View File
@@ -164,6 +164,7 @@ fn G() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main.import_ref.7f4 = import_ref Main//a, loc5_14, unloaded
// CHECK:STDOUT: %Main.F: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.a1f) = import_ref Main//a, F, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.cc3)]
// CHECK:STDOUT: %I.WithSelf.F.decl: %I.WithSelf.F.type.a1f = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.cc3)] {} {}
// CHECK:STDOUT: %Main.import_ref.2362f8.2: %I.type = import_ref Main//a, loc4_13, loaded [symbolic = constants.%Self.651]
// CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//a, loc4_13, unloaded
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
@@ -307,7 +308,7 @@ fn G() {
// CHECK:STDOUT: %specific_impl_fn.2: <specific function> = specific_impl_function %impl.elem0.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)]
// CHECK:STDOUT: %bound_method.4: <bound method> = bound_method %.6, %specific_impl_fn.2 [symbolic = %bound_method.4 (constants.%bound_method.fc8)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%x.param: %empty_struct_type) [thunk @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1] {
// CHECK:STDOUT: fn(%x.param: %empty_struct_type) [thunk @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1 for imports.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc8: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = specific_constant @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1, @C.as.I.impl(constants.%Y) [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %F.ref: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = name_ref F, %.loc8 [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)]
@@ -405,6 +406,11 @@ fn G() {
// CHECK:STDOUT: %I.impl_witness.e46: <witness> = impl_witness imports.%I.impl_witness_table, @C.as.I.impl(%Y) [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.type.627915.1: type = fn_type @C.as.I.impl.F.1, @C.as.I.impl(%Y) [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.7061c2.1: %C.as.I.impl.F.type.627915.1 = struct_value () [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.type.627915.2: type = fn_type @C.as.I.impl.F.2, @C.as.I.impl(%Y) [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.7061c2.2: %C.as.I.impl.F.type.627915.2 = struct_value () [symbolic]
// CHECK:STDOUT: %pattern_type.fb2: type = pattern_type %C.c8540f.2 [symbolic]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C.c8540f.2 [symbolic]
// CHECK:STDOUT: %I.facet.330: %I.type = facet_value %C.c8540f.2, (%I.impl_witness.e46) [symbolic]
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %C.c8540f.2, @Destroy [symbolic]
// CHECK:STDOUT: %Destroy.facet.3bf: %Destroy.type = facet_value %C.c8540f.2, (%Destroy.lookup_impl_witness) [symbolic]
@@ -412,12 +418,8 @@ fn G() {
// CHECK:STDOUT: %.634: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.696, %Destroy.facet.3bf [symbolic]
// CHECK:STDOUT: %impl.elem0: %.634 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic]
// CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op(%Destroy.facet.3bf) [symbolic]
// CHECK:STDOUT: %pattern_type.fb2: type = pattern_type %C.c8540f.2 [symbolic]
// CHECK:STDOUT: %C.val.6cb: %C.c8540f.2 = struct_value () [symbolic]
// CHECK:STDOUT: %.5fa: ref %C.c8540f.2 = temporary invalid, %C.val.6cb [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.type.627915.2: type = fn_type @C.as.I.impl.F.2, @C.as.I.impl(%Y) [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.7061c2.2: %C.as.I.impl.F.type.627915.2 = struct_value () [symbolic]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C.c8540f.2 [symbolic]
// CHECK:STDOUT: %bound_method.ff8: <bound method> = bound_method %.5fa, %specific_impl_fn [symbolic]
// CHECK:STDOUT: %bound_method.88b: <bound method> = bound_method %.5fa, %impl.elem0 [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.specific_fn.b2d: <specific function> = specific_function %C.as.I.impl.F.7061c2.2, @C.as.I.impl.F.2(%Y) [symbolic]
@@ -426,10 +428,10 @@ fn G() {
// CHECK:STDOUT: %C.as.I.impl.F.be0bb4.1: %C.as.I.impl.F.type.1bc610.1 = struct_value () [concrete]
// CHECK:STDOUT: %C.as.I.impl.F.type.1bc610.2: type = fn_type @C.as.I.impl.F.1, @C.as.I.impl(%empty_tuple) [concrete]
// CHECK:STDOUT: %C.as.I.impl.F.be0bb4.2: %C.as.I.impl.F.type.1bc610.2 = struct_value () [concrete]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %C.387, (%I.impl_witness.b70) [concrete]
// CHECK:STDOUT: %I.WithSelf.F.type.0c4: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet) [concrete]
// CHECK:STDOUT: %I.facet.478: %I.type = facet_value %C.387, (%I.impl_witness.b70) [concrete]
// CHECK:STDOUT: %I.WithSelf.F.type.0c4: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet.478) [concrete]
// CHECK:STDOUT: %I.WithSelf.F.b2b: %I.WithSelf.F.type.0c4 = struct_value () [concrete]
// CHECK:STDOUT: %.25a: type = fn_type_with_self_type %I.WithSelf.F.type.0c4, %I.facet [concrete]
// CHECK:STDOUT: %.25a: type = fn_type_with_self_type %I.WithSelf.F.type.0c4, %I.facet.478 [concrete]
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
// CHECK:STDOUT: %C.as.I.impl.F.specific_fn.53944e.1: <specific function> = specific_function %C.as.I.impl.F.be0bb4.2, @C.as.I.impl.F.1(%empty_tuple) [concrete]
// CHECK:STDOUT: %pattern_type.678: type = pattern_type %C.387 [concrete]
@@ -458,14 +460,15 @@ fn G() {
// CHECK:STDOUT: %Main.import_ref.c90e1a.1: %empty_tuple.type = import_ref Main//b, loc5_10, loaded [symbolic = @C.%X (constants.%X)]
// CHECK:STDOUT: %Main.import_ref.a54: %I.assoc_type = import_ref Main//a, loc5_14, loaded [concrete = constants.%assoc0.a42]
// CHECK:STDOUT: %Main.F.768 = import_ref Main//a, F, unloaded
// CHECK:STDOUT: %I.WithSelf.F.decl: %I.WithSelf.F.type.a1f = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.cc3)] {} {}
// CHECK:STDOUT: %Main.import_ref.2362f8.2: %I.type = import_ref Main//a, loc4_13, loaded [symbolic = constants.%Self.651]
// CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//a, loc4_13, unloaded
// CHECK:STDOUT: %Main.import_ref.972: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.a1f) = import_ref Main//a, loc5_14, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.cc3)]
// CHECK:STDOUT: %Main.import_ref.e97: <witness> = import_ref Main//b, loc7_32, loaded [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness.e46)]
// CHECK:STDOUT: %Main.import_ref.09c: @C.as.I.impl.%C.as.I.impl.F.type.2 (%C.as.I.impl.F.type.627915.1) = import_ref Main//b, loc8_24, loaded [symbolic = @C.as.I.impl.%C.as.I.impl.F.2 (constants.%C.as.I.impl.F.7061c2.1)]
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.09c), @C.as.I.impl [concrete]
// CHECK:STDOUT: %Main.F.d0d: @C.as.I.impl.%C.as.I.impl.F.type.1 (%C.as.I.impl.F.type.627915.2) = import_ref Main//b, F, loaded [symbolic = @C.as.I.impl.%C.as.I.impl.F.1 (constants.%C.as.I.impl.F.7061c2.2)]
// CHECK:STDOUT: %Main.import_ref.c90e1a.2: %empty_tuple.type = import_ref Main//b, loc7_15, loaded [symbolic = @C.as.I.impl.%Y (constants.%Y)]
// CHECK:STDOUT: %Main.F.d0d: @C.as.I.impl.%C.as.I.impl.F.type.1 (%C.as.I.impl.F.type.627915.2) = import_ref Main//b, F, loaded [symbolic = @C.as.I.impl.%C.as.I.impl.F.1 (constants.%C.as.I.impl.F.7061c2.2)]
// CHECK:STDOUT: %Main.import_ref.c90e1a.3: %empty_tuple.type = import_ref Main//b, loc7_15, loaded [symbolic = @C.as.I.impl.%Y (constants.%Y)]
// CHECK:STDOUT: %Main.import_ref.2e2: type = import_ref Main//b, loc7_25, loaded [symbolic = @C.as.I.impl.%C (constants.%C.c8540f.2)]
// CHECK:STDOUT: %Main.import_ref.91f: type = import_ref Main//b, loc7_30, loaded [concrete = constants.%I.type]
@@ -533,8 +536,8 @@ fn G() {
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_tuple) [concrete = constants.%C.387]
// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
// CHECK:STDOUT: %F.ref.loc7_11: %I.assoc_type = name_ref F, imports.%Main.import_ref.a54 [concrete = constants.%assoc0.a42]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (constants.%I.impl_witness.b70) [concrete = constants.%I.facet]
// CHECK:STDOUT: %.loc7_8: %I.type = converted %C, %I.facet [concrete = constants.%I.facet]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (constants.%I.impl_witness.b70) [concrete = constants.%I.facet.478]
// CHECK:STDOUT: %.loc7_8: %I.type = converted %C, %I.facet [concrete = constants.%I.facet.478]
// CHECK:STDOUT: %impl.elem0: %.25a = impl_witness_access constants.%I.impl_witness.b70, element0 [concrete = constants.%C.as.I.impl.F.be0bb4.2]
// CHECK:STDOUT: %.loc7_16.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %empty_struct.loc7_16.1: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
@@ -559,7 +562,7 @@ fn G() {
// CHECK:STDOUT: fn;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @C.as.I.impl.F.1(imports.%Main.import_ref.c90e1a.2: %empty_tuple.type) [from "b.carbon"] {
// CHECK:STDOUT: generic fn @C.as.I.impl.F.1(imports.%Main.import_ref.c90e1a.3: %empty_tuple.type) [from "b.carbon"] {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Y: %empty_tuple.type = symbolic_binding Y, 0 [symbolic = %Y (constants.%Y)]
// CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F.2, @C.as.I.impl(%Y) [symbolic = %C.as.I.impl.F.type (constants.%C.as.I.impl.F.type.627915.2)]
@@ -578,10 +581,10 @@ fn G() {
// CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn (constants.%specific_impl_fn)]
// CHECK:STDOUT: %bound_method.2: <bound method> = bound_method %.1, %specific_impl_fn [symbolic = %bound_method.2 (constants.%bound_method.ff8)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn [thunk imports.%Main.F.d0d];
// CHECK:STDOUT: fn [thunk imports.%Main.F.d0d for imports.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.330)];
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @C.as.I.impl.F.2(imports.%Main.import_ref.c90e1a.3: %empty_tuple.type) [from "b.carbon"] {
// CHECK:STDOUT: generic fn @C.as.I.impl.F.2(imports.%Main.import_ref.c90e1a.2: %empty_tuple.type) [from "b.carbon"] {
// CHECK:STDOUT: %Y: %empty_tuple.type = symbolic_binding Y, 0 [symbolic = %Y (constants.%Y)]
// CHECK:STDOUT: %C: type = class_type @C, @C(%Y) [symbolic = %C (constants.%C.c8540f.2)]
// CHECK:STDOUT: %pattern_type: type = pattern_type %C [symbolic = %pattern_type (constants.%pattern_type.fb2)]
@@ -645,6 +648,8 @@ fn G() {
// CHECK:STDOUT: %require_complete => constants.%require_complete
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet.330) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @C.as.I.impl.F.1(constants.%Y) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @C.as.I.impl(constants.%empty_tuple) {
@@ -659,9 +664,9 @@ fn G() {
// CHECK:STDOUT: %C.as.I.impl.F.2 => constants.%C.as.I.impl.F.be0bb4.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
// CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet.478) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Self => constants.%I.facet
// CHECK:STDOUT: %Self => constants.%I.facet.478
// CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.0c4
// CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.b2b
// CHECK:STDOUT: }
+4 -4
View File
@@ -2727,7 +2727,7 @@ fn F() {
// CHECK:STDOUT: return <error>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @E.as.J.impl.F.loc27_21.2(%u.param: %i32) -> out %return.param: %i32 [thunk @E.as.J.impl.%E.as.J.impl.F.decl.loc27_21.1] {
// CHECK:STDOUT: fn @E.as.J.impl.F.loc27_21.2(%u.param: %i32) -> out %return.param: %i32 [thunk @E.as.J.impl.%E.as.J.impl.F.decl.loc27_21.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %E.as.J.impl.F.type.4b5c2a.1 = name_ref F, @E.as.J.impl.%E.as.J.impl.F.decl.loc27_21.1 [concrete = constants.%E.as.J.impl.F.b4e6ab.1]
// CHECK:STDOUT: %E.as.J.impl.F.call: <error> = call %F.ref(<error>)
@@ -3455,7 +3455,7 @@ fn F() {
// CHECK:STDOUT: return %.loc23_50
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_40.2(%self.param: %empty_tuple.type) -> <error> [thunk @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_40.1] {
// CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_40.2(%self.param: %empty_tuple.type) -> <error> [thunk @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_40.1 for @J2.WithSelf.%J2.WithSelf.F.decl, @J2.WithSelf.F(constants.%J2.facet.6c9)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = name_ref F, @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_40.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1]
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -3473,7 +3473,7 @@ fn F() {
// CHECK:STDOUT: return %.loc32_53.4
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_40.2(%self.param: %C2) -> <error> [thunk @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_40.1] {
// CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_40.2(%self.param: %C2) -> <error> [thunk @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_40.1 for @J2.WithSelf.%J2.WithSelf.F.decl, @J2.WithSelf.F(constants.%J2.facet.f19)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %C2.as.J2.impl.F.type.d2a210.1 = name_ref F, @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_40.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1]
// CHECK:STDOUT: %C2.as.J2.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
@@ -3730,7 +3730,7 @@ fn F() {
// CHECK:STDOUT: return %.loc26_62
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_52.2(%self.param: %empty_tuple.type, %v.param: %struct_type.a) -> out %return.param: %struct_type.a [thunk @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_52.1] {
// CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_52.2(%self.param: %empty_tuple.type, %v.param: %struct_type.a) -> out %return.param: %struct_type.a [thunk @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_52.1 for @K.WithSelf.%K.WithSelf.F.decl, @K.WithSelf.F(constants.%K.facet)] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = name_ref F, @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_52.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1]
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.bound: <bound method> = bound_method %self.param, %F.ref