Rebuild all constants in the eval block. (#4155)

Instead of reusing instructions from the generic entity in the eval
block, rebuild constants in the same way we rebuild types. The previous
attempt to not rebuild these constants assumed that every constant used
in a generic would be built in that generic, and not referenced directly
or referenced from some enclosing scope, which isn't true in practice
and is a fragile assumption in any case.

We could add back some reuse of instructions from the generic -- if we
happen to see the right instruction to build a constant, we could
opportunistically reuse it -- but given the complexity added by doing
so, I'm not pursuing that here.

Now that the eval block for a generic consists of instructions uniquely
owned by that generic, rather than often being shared with another
entity, include the generic in the formatted SemIR output. I'm using the
same scope name for the generic object itself as for the parameterized
class / function / interface, because there are very frequently
references between them and this keeps the IR simpler and more readable,
and avoids needing to invent a second name for the scope.
This commit is contained in:
Richard Smith
2024-07-23 21:51:08 +00:00
committed by GitHub
parent db022658c6
commit fc8e686607
96 changed files with 3038 additions and 2385 deletions
+17 -15
View File
@@ -138,11 +138,11 @@ fn InstanceCallIndirect(p: i32*) {
// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {}
// CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4]
// CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] {
// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, %Self [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %.loc13_14.1: type = facet_type_access %Self.ref [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %.loc13_14.2: type = converted %Self.ref, %.loc13_14.1 [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %self.loc13_8.1: @Simple.%Self.ref (%Self) = param self
// CHECK:STDOUT: %self.loc13_8.2: @Simple.%Self.ref (%Self) = bind_name self, %self.loc13_8.1
// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, %Self [symbolic = @G.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc13_14.1: type = facet_type_access %Self.ref [symbolic = @G.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc13_14.2: type = converted %Self.ref, %.loc13_14.1 [symbolic = @G.1.%Self (constants.%Self)]
// CHECK:STDOUT: %self.loc13_8.1: @G.1.%Self (%Self) = param self
// CHECK:STDOUT: %self.loc13_8.2: @G.1.%Self (%Self) = bind_name self, %self.loc13_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc13_21: %.5 = assoc_entity element1, %G.decl [template = constants.%.6]
// CHECK:STDOUT:
@@ -170,11 +170,16 @@ fn InstanceCallIndirect(p: i32*) {
// CHECK:STDOUT: witness = %.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@Simple.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@Simple.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G.1[@Simple.%self.loc13_8.2: @Simple.%Self.ref (%Self)]()
// CHECK:STDOUT: generic [@Simple.%Self: %.1];
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @G.1(@Simple.%Self: %.1) {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[@Simple.%self.loc13_8.2: @G.1.%Self (%Self)]();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
@@ -227,12 +232,9 @@ fn InstanceCallIndirect(p: i32*) {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Simple.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Simple.%G.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @Simple.%Self.ref => constants.%Self
// CHECK:STDOUT: specific @G.1(constants.%Self) {
// CHECK:STDOUT: %Self => constants.%Self
// CHECK:STDOUT: }
// CHECK:STDOUT:
+5 -5
View File
@@ -99,8 +99,10 @@ fn G(c: C) {
// CHECK:STDOUT: extend name_scope2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@HasF.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@HasF.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2() {
// CHECK:STDOUT: !entry:
@@ -120,7 +122,5 @@ fn G(c: C) {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @HasF.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
+12 -10
View File
@@ -81,11 +81,11 @@ fn InstanceCall(n: i32) {
// CHECK:STDOUT: interface @Simple {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self]
// CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] {
// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, %Self [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref, %.loc12_14.1 [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %self.loc12_8.1: @Simple.%Self.ref (%Self) = param self
// CHECK:STDOUT: %self.loc12_8.2: @Simple.%Self.ref (%Self) = bind_name self, %self.loc12_8.1
// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, %Self [symbolic = @G.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref [symbolic = @G.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref, %.loc12_14.1 [symbolic = @G.1.%Self (constants.%Self)]
// CHECK:STDOUT: %self.loc12_8.1: @G.1.%Self (%Self) = param self
// CHECK:STDOUT: %self.loc12_8.2: @G.1.%Self (%Self) = bind_name self, %self.loc12_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc12_21: %.3 = assoc_entity element0, %G.decl [template = constants.%.4]
// CHECK:STDOUT:
@@ -108,8 +108,11 @@ fn InstanceCall(n: i32) {
// CHECK:STDOUT: witness = %.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G.1[@Simple.%self.loc12_8.2: @Simple.%Self.ref (%Self)]()
// CHECK:STDOUT: generic [@Simple.%Self: %.1];
// CHECK:STDOUT: generic fn @G.1(@Simple.%Self: %.1) {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[@Simple.%self.loc12_8.2: @G.1.%Self (%Self)]();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
@@ -125,8 +128,7 @@ fn InstanceCall(n: i32) {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Simple.%G.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @Simple.%Self.ref => constants.%Self
// CHECK:STDOUT: specific @G.1(constants.%Self) {
// CHECK:STDOUT: %Self => constants.%Self
// CHECK:STDOUT: }
// CHECK:STDOUT:
+47 -36
View File
@@ -28,7 +28,7 @@ class C {
// CHECK:STDOUT: %GenericInterface.type: type = generic_interface_type @GenericInterface [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %GenericInterface: %GenericInterface.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = interface_type @GenericInterface, file.%GenericInterface.decl(%T) [symbolic]
// CHECK:STDOUT: %.2: type = interface_type @GenericInterface, @GenericInterface(%T) [symbolic]
// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 1 [symbolic]
// CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
// CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
@@ -59,32 +59,39 @@ class C {
// CHECK:STDOUT: }
// CHECK:STDOUT: %GenericInterface.decl: %GenericInterface.type = interface_decl @GenericInterface [template = constants.%GenericInterface] {
// CHECK:STDOUT: %T.loc11_28.1: type = param T
// CHECK:STDOUT: %T.loc11_28.2: type = bind_symbolic_name T 0, %T.loc11_28.1 [symbolic = %T.loc11_28.2 (constants.%T)]
// CHECK:STDOUT: %T.loc11_28.2: type = bind_symbolic_name T 0, %T.loc11_28.1 [symbolic = @GenericInterface.%T (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @GenericInterface
// CHECK:STDOUT: generic [file.%T.loc11_28.2: type] {
// CHECK:STDOUT: %Self: <unexpected>.inst+22 (%.2) = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {
// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_28.2 [symbolic = %T.ref (constants.%T)]
// CHECK:STDOUT: %x.loc12_8.1: @GenericInterface.%T.ref (%T) = param x
// CHECK:STDOUT: %x.loc12_8.2: @GenericInterface.%T.ref (%T) = bind_name x, %x.loc12_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4]
// CHECK:STDOUT: generic interface @GenericInterface(file.%T.loc11_28.2: type) {
// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
// CHECK:STDOUT: .F = %.loc12
// CHECK:STDOUT: witness = (%F.decl)
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %.1: type = interface_type @GenericInterface, @GenericInterface(%T) [symbolic = %.1 (constants.%.2)]
// CHECK:STDOUT: %Self.2: %.2 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)]
// CHECK:STDOUT:
// CHECK:STDOUT: interface {
// CHECK:STDOUT: %Self.1: @GenericInterface.%.1 (%.2) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)]
// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {
// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_28.2 [symbolic = @F.1.%T (constants.%T)]
// CHECK:STDOUT: %x.loc12_8.1: @F.1.%T (%T) = param x
// CHECK:STDOUT: %x.loc12_8.2: @F.1.%T (%T) = bind_name x, %x.loc12_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self.1
// CHECK:STDOUT: .F = %.loc12
// CHECK:STDOUT: witness = (%F.decl)
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @impl: %C as %.2 {
// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {
// CHECK:STDOUT: %T.ref: type = name_ref T, @C.%T.loc19_23.2 [symbolic = %T.ref (constants.%T)]
// CHECK:STDOUT: %x.loc20_10.1: @impl.%T.ref (%T) = param x
// CHECK:STDOUT: %x.loc20_10.2: @impl.%T.ref (%T) = bind_name x, %x.loc20_10.1
// CHECK:STDOUT: %T.ref: type = name_ref T, @C.%T.loc19_23.2 [symbolic = @F.2.%T (constants.%T)]
// CHECK:STDOUT: %x.loc20_10.1: @F.2.%T (%T) = param x
// CHECK:STDOUT: %x.loc20_10.2: @F.2.%T (%T) = bind_name x, %x.loc20_10.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.1: <witness> = interface_witness (%F.decl) [template = constants.%.5]
// CHECK:STDOUT:
@@ -109,32 +116,36 @@ class C {
// CHECK:STDOUT: has_error
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1(@GenericInterface.%x.loc12_8.2: @GenericInterface.%T.ref (%T))
// CHECK:STDOUT: generic [file.%T.loc11_28.2: type, @GenericInterface.%Self: <unexpected>.inst+22 (%.2)];
// CHECK:STDOUT: generic fn @F.1(file.%T.loc11_28.2: type, @GenericInterface.%Self.1: @GenericInterface.%.1 (%.2)) {
// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2(@impl.%x.loc20_10.2: @impl.%T.ref (%T))
// CHECK:STDOUT: generic [@C.%T.loc19_23.2: type] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: fn(@GenericInterface.%x.loc12_8.2: @F.1.%T (%T));
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%GenericInterface.decl(constants.%T) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%T.loc11_28.2 => constants.%T
// CHECK:STDOUT: generic fn @F.2(@C.%T.loc19_23.2: type) {
// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: fn(@impl.%x.loc20_10.2: @F.2.%T (%T)) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @GenericInterface.%F.decl(constants.%T, constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @GenericInterface.%T.ref => constants.%T
// CHECK:STDOUT: specific @GenericInterface(constants.%T) {
// CHECK:STDOUT: %T => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%GenericInterface.decl(file.%T.loc11_28.2) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%T.loc11_28.2 => constants.%T
// CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {
// CHECK:STDOUT: %T => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @impl.%F.decl(constants.%T) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @impl.%T.ref => constants.%T
// CHECK:STDOUT: specific @GenericInterface(@GenericInterface.%T) {
// CHECK:STDOUT: %T => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.2(constants.%T) {
// CHECK:STDOUT: %T => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -59,18 +59,19 @@ interface I {
// CHECK:STDOUT:
// CHECK:STDOUT: impl @impl: %C as %.1;
// CHECK:STDOUT:
// CHECK:STDOUT: class @C
// CHECK:STDOUT: generic [@I.%Self: %.1] {
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: generic class @C(@I.%Self: %.1) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: class {
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: has_error
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: has_error
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.%C.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @C(constants.%Self) {}
// CHECK:STDOUT:
+5 -5
View File
@@ -75,15 +75,15 @@ impl as Simple {
// CHECK:STDOUT: witness = %.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@Simple.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@Simple.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Simple.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
+72 -66
View File
@@ -278,26 +278,27 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: %.13: type = tuple_type (%.10, %.11) [symbolic]
// CHECK:STDOUT: %.14: i32 = int_literal 4 [template]
// CHECK:STDOUT: %.15: type = array_type %.14, %Self.3 [symbolic]
// CHECK:STDOUT: %.16: type = tuple_type (@F.13.%.1 (%.10), @F.13.%.2 (%.11)) [symbolic]
// CHECK:STDOUT: %F.type.13: type = fn_type @F.13 [template]
// CHECK:STDOUT: %F.14: %F.type.13 = struct_value () [template]
// CHECK:STDOUT: %.16: type = assoc_entity_type @SelfNested, %F.type.13 [template]
// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, @SelfNested.%F.decl [template]
// CHECK:STDOUT: %.17: type = assoc_entity_type @SelfNested, %F.type.13 [template]
// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, @SelfNested.%F.decl [template]
// CHECK:STDOUT: %SelfNestedBadParam: type = class_type @SelfNestedBadParam [template]
// CHECK:STDOUT: %.18: type = ptr_type %SelfNestedBadParam [template]
// CHECK:STDOUT: %.19: type = struct_type {.x: i32, .y: i32} [template]
// CHECK:STDOUT: %.20: type = tuple_type (%.18, %.19) [template]
// CHECK:STDOUT: %.21: type = array_type %.14, %SelfNestedBadParam [template]
// CHECK:STDOUT: %.19: type = ptr_type %SelfNestedBadParam [template]
// CHECK:STDOUT: %.20: type = struct_type {.x: i32, .y: i32} [template]
// CHECK:STDOUT: %.21: type = tuple_type (%.19, %.20) [template]
// CHECK:STDOUT: %.22: type = array_type %.14, %SelfNestedBadParam [template]
// CHECK:STDOUT: %F.type.14: type = fn_type @F.14 [template]
// CHECK:STDOUT: %F.15: %F.type.14 = struct_value () [template]
// CHECK:STDOUT: %.22: type = struct_type {.x: %SelfNestedBadParam, .y: i32} [template]
// CHECK:STDOUT: %.23: type = tuple_type (%.18, %.22) [template]
// CHECK:STDOUT: %.23: type = struct_type {.x: %SelfNestedBadParam, .y: i32} [template]
// CHECK:STDOUT: %.24: type = tuple_type (%.19, %.23) [template]
// CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [template]
// CHECK:STDOUT: %.24: type = ptr_type %SelfNestedBadReturnType [template]
// CHECK:STDOUT: %.25: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template]
// CHECK:STDOUT: %.26: type = tuple_type (%.24, %.25) [template]
// CHECK:STDOUT: %.25: type = ptr_type %SelfNestedBadReturnType [template]
// CHECK:STDOUT: %.26: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template]
// CHECK:STDOUT: %.27: type = tuple_type (%.25, %.26) [template]
// CHECK:STDOUT: %F.type.15: type = fn_type @F.15 [template]
// CHECK:STDOUT: %F.16: %F.type.15 = struct_value () [template]
// CHECK:STDOUT: %.27: type = array_type %.14, %SelfNestedBadReturnType [template]
// CHECK:STDOUT: %.28: type = array_type %.14, %SelfNestedBadReturnType [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -421,29 +422,29 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: interface @SelfNested {
// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 0 [symbolic = constants.%Self.3]
// CHECK:STDOUT: %F.decl: %F.type.13 = fn_decl @F.13 [template = constants.%F.14] {
// CHECK:STDOUT: %Self.ref.loc188_12: %.9 = name_ref Self, %Self [symbolic = %Self.ref.loc188_12 (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_16.1: type = facet_type_access %Self.ref.loc188_12 [symbolic = %Self.ref.loc188_12 (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_16.2: type = converted %Self.ref.loc188_12, %.loc188_16.1 [symbolic = %Self.ref.loc188_12 (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_16.3: type = ptr_type %Self.3 [symbolic = %.loc188_16.3 (constants.%.10)]
// CHECK:STDOUT: %Self.ref.loc188_24: %.9 = name_ref Self, %Self [symbolic = %Self.ref.loc188_12 (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_24.1: type = facet_type_access %Self.ref.loc188_24 [symbolic = %Self.ref.loc188_12 (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_24.2: type = converted %Self.ref.loc188_24, %.loc188_24.1 [symbolic = %Self.ref.loc188_12 (constants.%Self.3)]
// CHECK:STDOUT: %Self.ref.loc188_12: %.9 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_16.1: type = facet_type_access %Self.ref.loc188_12 [symbolic = @F.13.%Self (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_16.2: type = converted %Self.ref.loc188_12, %.loc188_16.1 [symbolic = @F.13.%Self (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_16.3: type = ptr_type %Self.3 [symbolic = @F.13.%.1 (constants.%.10)]
// CHECK:STDOUT: %Self.ref.loc188_24: %.9 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_24.1: type = facet_type_access %Self.ref.loc188_24 [symbolic = @F.13.%Self (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_24.2: type = converted %Self.ref.loc188_24, %.loc188_24.1 [symbolic = @F.13.%Self (constants.%Self.3)]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc188_34.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc188_34.2: type = converted %int.make_type_32, %.loc188_34.1 [template = i32]
// CHECK:STDOUT: %.loc188_37: type = struct_type {.x: %Self.3, .y: i32} [symbolic = %.loc188_37 (constants.%.11)]
// CHECK:STDOUT: %.loc188_37: type = struct_type {.x: %Self.3, .y: i32} [symbolic = @F.13.%.2 (constants.%.11)]
// CHECK:STDOUT: %.loc188_38.1: %.12 = tuple_literal (%.loc188_16.3, %.loc188_37)
// CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%.13 [symbolic = %.loc188_38.2 (constants.%.13)]
// CHECK:STDOUT: %x.loc188_8.1: @SelfNested.%.loc188_38.2 (%.13) = param x
// CHECK:STDOUT: %x.loc188_8.2: @SelfNested.%.loc188_38.2 (%.13) = bind_name x, %x.loc188_8.1
// CHECK:STDOUT: %Self.ref.loc188_45: %.9 = name_ref Self, %Self [symbolic = %Self.ref.loc188_12 (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%.13 [symbolic = @F.13.%.3 (constants.%.13)]
// CHECK:STDOUT: %x.loc188_8.1: @F.13.%.3 (%.13) = param x
// CHECK:STDOUT: %x.loc188_8.2: @F.13.%.3 (%.13) = bind_name x, %x.loc188_8.1
// CHECK:STDOUT: %Self.ref.loc188_45: %.9 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_51: i32 = int_literal 4 [template = constants.%.14]
// CHECK:STDOUT: %.loc188_45.1: type = facet_type_access %Self.ref.loc188_45 [symbolic = %Self.ref.loc188_12 (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_45.2: type = converted %Self.ref.loc188_45, %.loc188_45.1 [symbolic = %Self.ref.loc188_12 (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_52: type = array_type %.loc188_51, %Self.3 [symbolic = %.loc188_52 (constants.%.15)]
// CHECK:STDOUT: %.loc188_45.1: type = facet_type_access %Self.ref.loc188_45 [symbolic = @F.13.%Self (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_45.2: type = converted %Self.ref.loc188_45, %.loc188_45.1 [symbolic = @F.13.%Self (constants.%Self.3)]
// CHECK:STDOUT: %.loc188_52: type = array_type %.loc188_51, %Self.3 [symbolic = @F.13.%.4 (constants.%.15)]
// CHECK:STDOUT: %return.var: ref %.15 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc188_53: %.16 = assoc_entity element0, %F.decl [template = constants.%.17]
// CHECK:STDOUT: %.loc188_53: %.17 = assoc_entity element0, %F.decl [template = constants.%.18]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
@@ -670,22 +671,22 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: impl @impl.14: %SelfNestedBadParam as %.9 {
// CHECK:STDOUT: %F.decl: %F.type.14 = fn_decl @F.14 [template = constants.%F.15] {
// CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
// CHECK:STDOUT: %.loc200_32: type = ptr_type %SelfNestedBadParam [template = constants.%.18]
// CHECK:STDOUT: %.loc200_32: type = ptr_type %SelfNestedBadParam [template = constants.%.19]
// CHECK:STDOUT: %int.make_type_32.loc200_40: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc200_40.1: type = value_of_initializer %int.make_type_32.loc200_40 [template = i32]
// CHECK:STDOUT: %.loc200_40.2: type = converted %int.make_type_32.loc200_40, %.loc200_40.1 [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc200_49: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc200_49.1: type = value_of_initializer %int.make_type_32.loc200_49 [template = i32]
// CHECK:STDOUT: %.loc200_49.2: type = converted %int.make_type_32.loc200_49, %.loc200_49.1 [template = i32]
// CHECK:STDOUT: %.loc200_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.19]
// CHECK:STDOUT: %.loc200_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.20]
// CHECK:STDOUT: %.loc200_53.1: %.12 = tuple_literal (%.loc200_32, %.loc200_52)
// CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%.20 [template = constants.%.20]
// CHECK:STDOUT: %x.loc200_10.1: %.20 = param x
// CHECK:STDOUT: %x.loc200_10.2: %.20 = bind_name x, %x.loc200_10.1
// CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%.21 [template = constants.%.21]
// CHECK:STDOUT: %x.loc200_10.1: %.21 = param x
// CHECK:STDOUT: %x.loc200_10.2: %.21 = bind_name x, %x.loc200_10.1
// CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_60: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
// CHECK:STDOUT: %.loc200_80: i32 = int_literal 4 [template = constants.%.14]
// CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80, %SelfNestedBadParam [template = constants.%.21]
// CHECK:STDOUT: %return.var: ref %.21 = var <return slot>
// CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80, %SelfNestedBadParam [template = constants.%.22]
// CHECK:STDOUT: %return.var: ref %.22 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
// CHECK:STDOUT:
@@ -697,20 +698,20 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: impl @impl.15: %SelfNestedBadReturnType as %.9 {
// CHECK:STDOUT: %F.decl: %F.type.15 = fn_decl @F.15 [template = constants.%F.16] {
// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType]
// CHECK:STDOUT: %.loc212_37: type = ptr_type %SelfNestedBadReturnType [template = constants.%.24]
// CHECK:STDOUT: %.loc212_37: type = ptr_type %SelfNestedBadReturnType [template = constants.%.25]
// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc212_74.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc212_74.2: type = converted %int.make_type_32, %.loc212_74.1 [template = i32]
// CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template = constants.%.25]
// CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template = constants.%.26]
// CHECK:STDOUT: %.loc212_78.1: %.12 = tuple_literal (%.loc212_37, %.loc212_77)
// CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%.26 [template = constants.%.26]
// CHECK:STDOUT: %x.loc212_10.1: %.26 = param x
// CHECK:STDOUT: %x.loc212_10.2: %.26 = bind_name x, %x.loc212_10.1
// CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%.27 [template = constants.%.27]
// CHECK:STDOUT: %x.loc212_10.1: %.27 = param x
// CHECK:STDOUT: %x.loc212_10.2: %.27 = bind_name x, %x.loc212_10.1
// CHECK:STDOUT: %SelfNestedBadParam.ref: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
// CHECK:STDOUT: %.loc212_105: i32 = int_literal 4 [template = constants.%.14]
// CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105, %SelfNestedBadParam [template = constants.%.21]
// CHECK:STDOUT: %return.var: ref %.21 = var <return slot>
// CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105, %SelfNestedBadParam [template = constants.%.22]
// CHECK:STDOUT: %return.var: ref %.22 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
// CHECK:STDOUT:
@@ -856,8 +857,10 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: .Self = constants.%SelfNestedBadReturnType
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@I.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@I.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @PossiblyF();
// CHECK:STDOUT:
@@ -869,8 +872,10 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.4() -> bool;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.5[@J.%self.loc93_20.2: bool](@J.%b.loc93_32.2: bool) -> bool
// CHECK:STDOUT: generic [@J.%Self: %.6];
// CHECK:STDOUT: generic fn @F.5(@J.%Self: %.6) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn[@J.%self.loc93_20.2: bool](@J.%b.loc93_32.2: bool) -> bool;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.6[@impl.7.%self.loc104_10.2: bool]() -> bool;
// CHECK:STDOUT:
@@ -888,28 +893,29 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.13(@SelfNested.%x.loc188_8.2: @SelfNested.%.loc188_38.2 (%.13)) -> %.15
// CHECK:STDOUT: generic [@SelfNested.%Self: %.9];
// CHECK:STDOUT: generic fn @F.13(@SelfNested.%Self: %.9) {
// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.3)]
// CHECK:STDOUT: %.1: type = ptr_type @F.13.%Self (%Self.3) [symbolic = %.1 (constants.%.10)]
// CHECK:STDOUT: %.2: type = struct_type {.x: @F.13.%Self (%Self.3), .y: i32} [symbolic = %.2 (constants.%.11)]
// CHECK:STDOUT: %.3: type = tuple_type (@F.13.%.1 (%.10), @F.13.%.2 (%.11)) [symbolic = %.3 (constants.%.13)]
// CHECK:STDOUT: %.4: type = array_type constants.%.14, @F.13.%Self (%Self.3) [symbolic = %.4 (constants.%.15)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.14(@impl.14.%x.loc200_10.2: %.20) -> %.21;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.15(@impl.15.%x.loc212_10.2: %.26) -> %.21;
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.%F.decl(constants.%Self.1) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: fn(@SelfNested.%x.loc188_8.2: @F.13.%.3 (%.13)) -> %.15;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @J.%F.decl(constants.%Self.2) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @SelfNested.%F.decl(constants.%Self.3) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @SelfNested.%Self.ref.loc188_12 => constants.%Self.3
// CHECK:STDOUT: @SelfNested.%.loc188_16.3 => constants.%.10
// CHECK:STDOUT: <unexpected>.inst+267.loc188_21 => <unexpected>.inst+268
// CHECK:STDOUT: @SelfNested.%.loc188_37 => constants.%.11
// CHECK:STDOUT: @SelfNested.%.loc188_38.2 => constants.%.13
// CHECK:STDOUT: @SelfNested.%.loc188_52 => constants.%.15
// CHECK:STDOUT: fn @F.14(@impl.14.%x.loc200_10.2: %.21) -> %.22;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.15(@impl.15.%x.loc212_10.2: %.27) -> %.22;
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.1(constants.%Self.1) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.5(constants.%Self.2) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.13(constants.%Self.3) {
// CHECK:STDOUT: %Self => constants.%Self.3
// CHECK:STDOUT: %.1 => constants.%.10
// CHECK:STDOUT: %.2 => constants.%.11
// CHECK:STDOUT: %.3 => constants.%.16
// CHECK:STDOUT: %.4 => constants.%.15
// CHECK:STDOUT: }
// CHECK:STDOUT:
+5 -5
View File
@@ -89,8 +89,10 @@ class C {
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@Simple.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@Simple.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2() {
// CHECK:STDOUT: !entry:
@@ -104,7 +106,5 @@ class C {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Simple.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
+12 -11
View File
@@ -76,20 +76,21 @@ impl forall [T:! type] T as Simple {
// CHECK:STDOUT: witness = %.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@Simple.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@Simple.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2()
// CHECK:STDOUT: generic [file.%T.loc15_14.2: type] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Simple.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: generic fn @F.2(file.%T.loc15_14.2: type) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: fn() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @impl.%F.decl(constants.%T) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.2(constants.%T) {}
// CHECK:STDOUT:
+5 -5
View File
@@ -105,8 +105,10 @@ fn G(c: C) {
// CHECK:STDOUT: .G = %G
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@HasF.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@HasF.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2() {
// CHECK:STDOUT: !entry:
@@ -126,7 +128,5 @@ fn G(c: C) {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @HasF.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
@@ -92,8 +92,10 @@ fn F(c: C) {
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@I.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@I.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2(%c: %C) {
// CHECK:STDOUT: !entry:
@@ -104,7 +106,5 @@ fn F(c: C) {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
@@ -115,8 +115,10 @@ impl C as I {
// CHECK:STDOUT: extend name_scope2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@I.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@I.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
@@ -132,7 +134,5 @@ impl C as I {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
+5 -5
View File
@@ -96,17 +96,17 @@ fn G(c: Impl.C) {
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@HasF.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@HasF.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @HasF.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- use.carbon
// CHECK:STDOUT:
+12 -10
View File
@@ -86,11 +86,11 @@ fn F(c: C) -> i32 {
// CHECK:STDOUT: interface @I {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self]
// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {
// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, %Self [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %.loc14_14.1: type = facet_type_access %Self.ref [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %.loc14_14.2: type = converted %Self.ref, %.loc14_14.1 [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %self.loc14_8.1: @I.%Self.ref (%Self) = param self
// CHECK:STDOUT: %self.loc14_8.2: @I.%Self.ref (%Self) = bind_name self, %self.loc14_8.1
// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc14_14.1: type = facet_type_access %Self.ref [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc14_14.2: type = converted %Self.ref, %.loc14_14.1 [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %self.loc14_8.1: @F.1.%Self (%Self) = param self
// CHECK:STDOUT: %self.loc14_8.2: @F.1.%Self (%Self) = bind_name self, %self.loc14_8.1
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc14_25.2: type = converted %int.make_type_32, %.loc14_25.1 [template = i32]
@@ -133,8 +133,11 @@ fn F(c: C) -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1[@I.%self.loc14_8.2: @I.%Self.ref (%Self)]() -> i32
// CHECK:STDOUT: generic [@I.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@I.%Self: %.1) {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[@I.%self.loc14_8.2: @F.1.%Self (%Self)]() -> i32;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2[@impl.%self.loc19_10.2: %C]() -> i32;
// CHECK:STDOUT:
@@ -150,8 +153,7 @@ fn F(c: C) -> i32 {
// CHECK:STDOUT: return %.loc24_15.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @I.%Self.ref => constants.%Self
// CHECK:STDOUT: specific @F.1(constants.%Self) {
// CHECK:STDOUT: %Self => constants.%Self
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -85,17 +85,17 @@ fn G(c: Impl.C) {
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@HasF.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@HasF.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @HasF.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- use.carbon
// CHECK:STDOUT:
+5 -5
View File
@@ -73,15 +73,15 @@ impl C as Simple {
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1()
// CHECK:STDOUT: generic [@Simple.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@Simple.%Self: %.1) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Simple.%F.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: }
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
+21 -19
View File
@@ -52,19 +52,19 @@ fn F(x: (), y: ()) -> () {
// CHECK:STDOUT: interface @Add {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self]
// CHECK:STDOUT: %Op.decl: %Op.type = fn_decl @Op [template = constants.%Op] {
// CHECK:STDOUT: %Self.ref.loc5_15: %.1 = name_ref Self, %Self [symbolic = %Self.ref.loc5_15 (constants.%Self)]
// CHECK:STDOUT: %.loc5_15.1: type = facet_type_access %Self.ref.loc5_15 [symbolic = %Self.ref.loc5_15 (constants.%Self)]
// CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref.loc5_15, %.loc5_15.1 [symbolic = %Self.ref.loc5_15 (constants.%Self)]
// CHECK:STDOUT: %self.loc5_9.1: @Add.%Self.ref.loc5_15 (%Self) = param self
// CHECK:STDOUT: %self.loc5_9.2: @Add.%Self.ref.loc5_15 (%Self) = bind_name self, %self.loc5_9.1
// CHECK:STDOUT: %Self.ref.loc5_28: %.1 = name_ref Self, %Self [symbolic = %Self.ref.loc5_15 (constants.%Self)]
// CHECK:STDOUT: %.loc5_28.1: type = facet_type_access %Self.ref.loc5_28 [symbolic = %Self.ref.loc5_15 (constants.%Self)]
// CHECK:STDOUT: %.loc5_28.2: type = converted %Self.ref.loc5_28, %.loc5_28.1 [symbolic = %Self.ref.loc5_15 (constants.%Self)]
// CHECK:STDOUT: %other.loc5_21.1: @Add.%Self.ref.loc5_15 (%Self) = param other
// CHECK:STDOUT: %other.loc5_21.2: @Add.%Self.ref.loc5_15 (%Self) = bind_name other, %other.loc5_21.1
// CHECK:STDOUT: %Self.ref.loc5_37: %.1 = name_ref Self, %Self [symbolic = %Self.ref.loc5_15 (constants.%Self)]
// CHECK:STDOUT: %.loc5_37.1: type = facet_type_access %Self.ref.loc5_37 [symbolic = %Self.ref.loc5_15 (constants.%Self)]
// CHECK:STDOUT: %.loc5_37.2: type = converted %Self.ref.loc5_37, %.loc5_37.1 [symbolic = %Self.ref.loc5_15 (constants.%Self)]
// CHECK:STDOUT: %Self.ref.loc5_15: %.1 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc5_15.1: type = facet_type_access %Self.ref.loc5_15 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref.loc5_15, %.loc5_15.1 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %self.loc5_9.1: @Op.%Self (%Self) = param self
// CHECK:STDOUT: %self.loc5_9.2: @Op.%Self (%Self) = bind_name self, %self.loc5_9.1
// CHECK:STDOUT: %Self.ref.loc5_28: %.1 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc5_28.1: type = facet_type_access %Self.ref.loc5_28 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc5_28.2: type = converted %Self.ref.loc5_28, %.loc5_28.1 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %other.loc5_21.1: @Op.%Self (%Self) = param other
// CHECK:STDOUT: %other.loc5_21.2: @Op.%Self (%Self) = bind_name other, %other.loc5_21.1
// CHECK:STDOUT: %Self.ref.loc5_37: %.1 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc5_37.1: type = facet_type_access %Self.ref.loc5_37 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc5_37.2: type = converted %Self.ref.loc5_37, %.loc5_37.1 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %return.var: ref %Self = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc5_41: %.3 = assoc_entity element0, %Op.decl [template = constants.%.4]
@@ -75,12 +75,14 @@ fn F(x: (), y: ()) -> () {
// CHECK:STDOUT: witness = (%Op.decl)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Op[@Add.%self.loc5_9.2: @Add.%Self.ref.loc5_15 (%Self)](@Add.%other.loc5_21.2: @Add.%Self.ref.loc5_15 (%Self)) -> %Self
// CHECK:STDOUT: generic [@Add.%Self: %.1];
// CHECK:STDOUT: generic fn @Op(@Add.%Self: %.1) {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Add.%Op.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @Add.%Self.ref.loc5_15 => constants.%Self
// CHECK:STDOUT: fn[@Add.%self.loc5_9.2: @Op.%Self (%Self)](@Add.%other.loc5_21.2: @Op.%Self (%Self)) -> %Self;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Op(constants.%Self) {
// CHECK:STDOUT: %Self => constants.%Self
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- b.carbon
@@ -104,7 +106,7 @@ fn F(x: (), y: ()) -> () {
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+3, unloaded
// CHECK:STDOUT: %import_ref.3: %.4 = import_ref Main//a, inst+24, loaded [template = constants.%.5]
// CHECK:STDOUT: %import_ref.3: %.4 = import_ref Main//a, inst+25, loaded [template = constants.%.5]
// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Main//a, inst+19, loaded [template = constants.%Op.2]
// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+19, unloaded
// CHECK:STDOUT: }
@@ -56,9 +56,9 @@ class A {
// CHECK:STDOUT: interface @DefaultConstructible {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self]
// CHECK:STDOUT: %Make.decl: %Make.type.1 = fn_decl @Make.1 [template = constants.%Make.1] {
// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, %Self [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %.loc12_16.1: type = facet_type_access %Self.ref [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %.loc12_16.2: type = converted %Self.ref, %.loc12_16.1 [symbolic = %Self.ref (constants.%Self)]
// CHECK:STDOUT: %Self.ref: %.1 = name_ref Self, %Self [symbolic = @Make.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_16.1: type = facet_type_access %Self.ref [symbolic = @Make.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_16.2: type = converted %Self.ref, %.loc12_16.1 [symbolic = @Make.1.%Self (constants.%Self)]
// CHECK:STDOUT: %return.var: ref %Self = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc12_20: %.3 = assoc_entity element0, %Make.decl [template = constants.%.4]
@@ -96,8 +96,11 @@ class A {
// CHECK:STDOUT: .Self = constants.%A
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Make.1() -> %Self
// CHECK:STDOUT: generic [@DefaultConstructible.%Self: %.1];
// CHECK:STDOUT: generic fn @Make.1(@DefaultConstructible.%Self: %.1) {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn() -> %Self;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Make.2() -> @impl.%return.var: %C {
// CHECK:STDOUT: !entry:
@@ -107,8 +110,7 @@ class A {
// CHECK:STDOUT: return %.loc21_34 to @impl.%return.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @DefaultConstructible.%Make.decl(constants.%Self) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @DefaultConstructible.%Self.ref => constants.%Self
// CHECK:STDOUT: specific @Make.1(constants.%Self) {
// CHECK:STDOUT: %Self => constants.%Self
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -64,22 +64,23 @@ impl D as SelfNested {
// CHECK:STDOUT: %.11: type = struct_type {.x: %Self.2, .y: %.2} [symbolic]
// CHECK:STDOUT: %.12: type = tuple_type (type, type) [template]
// CHECK:STDOUT: %.13: type = tuple_type (%.10, %.11) [symbolic]
// CHECK:STDOUT: %.14: type = tuple_type (@F.4.%.1 (%.10), @F.4.%.2 (%.11)) [symbolic]
// CHECK:STDOUT: %F.type.4: type = fn_type @F.4 [template]
// CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [template]
// CHECK:STDOUT: %.14: type = assoc_entity_type @SelfNested, %F.type.4 [template]
// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, @SelfNested.%F.decl [template]
// CHECK:STDOUT: %.16: type = ptr_type %C [template]
// CHECK:STDOUT: %.17: type = struct_type {.x: %C, .y: %.2} [template]
// CHECK:STDOUT: %.18: type = tuple_type (%.16, %.17) [template]
// CHECK:STDOUT: %.15: type = assoc_entity_type @SelfNested, %F.type.4 [template]
// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, @SelfNested.%F.decl [template]
// CHECK:STDOUT: %.17: type = ptr_type %C [template]
// CHECK:STDOUT: %.18: type = struct_type {.x: %C, .y: %.2} [template]
// CHECK:STDOUT: %.19: type = tuple_type (%.17, %.18) [template]
// CHECK:STDOUT: %F.type.5: type = fn_type @F.5 [template]
// CHECK:STDOUT: %F.5: %F.type.5 = struct_value () [template]
// CHECK:STDOUT: %.19: <witness> = interface_witness (%F.5) [template]
// CHECK:STDOUT: %.20: type = ptr_type %D [template]
// CHECK:STDOUT: %.21: type = struct_type {.x: %D, .y: %.2} [template]
// CHECK:STDOUT: %.22: type = tuple_type (%.20, %.21) [template]
// CHECK:STDOUT: %.20: <witness> = interface_witness (%F.5) [template]
// CHECK:STDOUT: %.21: type = ptr_type %D [template]
// CHECK:STDOUT: %.22: type = struct_type {.x: %D, .y: %.2} [template]
// CHECK:STDOUT: %.23: type = tuple_type (%.21, %.22) [template]
// CHECK:STDOUT: %F.type.6: type = fn_type @F.6 [template]
// CHECK:STDOUT: %F.6: %F.type.6 = struct_value () [template]
// CHECK:STDOUT: %.23: <witness> = interface_witness (%F.6) [template]
// CHECK:STDOUT: %.24: <witness> = interface_witness (%F.6) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -114,19 +115,19 @@ impl D as SelfNested {
// CHECK:STDOUT: interface @UseSelf {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self.1]
// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {
// CHECK:STDOUT: %Self.ref.loc12_14: %.1 = name_ref Self, %Self [symbolic = %Self.ref.loc12_14 (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = %Self.ref.loc12_14 (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = %Self.ref.loc12_14 (constants.%Self.1)]
// CHECK:STDOUT: %self.loc12_8.1: @UseSelf.%Self.ref.loc12_14 (%Self.1) = param self
// CHECK:STDOUT: %self.loc12_8.2: @UseSelf.%Self.ref.loc12_14 (%Self.1) = bind_name self, %self.loc12_8.1
// CHECK:STDOUT: %Self.ref.loc12_23: %.1 = name_ref Self, %Self [symbolic = %Self.ref.loc12_14 (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_23.1: type = facet_type_access %Self.ref.loc12_23 [symbolic = %Self.ref.loc12_14 (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_23.2: type = converted %Self.ref.loc12_23, %.loc12_23.1 [symbolic = %Self.ref.loc12_14 (constants.%Self.1)]
// CHECK:STDOUT: %x.loc12_20.1: @UseSelf.%Self.ref.loc12_14 (%Self.1) = param x
// CHECK:STDOUT: %x.loc12_20.2: @UseSelf.%Self.ref.loc12_14 (%Self.1) = bind_name x, %x.loc12_20.1
// CHECK:STDOUT: %Self.ref.loc12_32: %.1 = name_ref Self, %Self [symbolic = %Self.ref.loc12_14 (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_32.1: type = facet_type_access %Self.ref.loc12_32 [symbolic = %Self.ref.loc12_14 (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_32.2: type = converted %Self.ref.loc12_32, %.loc12_32.1 [symbolic = %Self.ref.loc12_14 (constants.%Self.1)]
// CHECK:STDOUT: %Self.ref.loc12_14: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = @F.1.%Self (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = @F.1.%Self (constants.%Self.1)]
// CHECK:STDOUT: %self.loc12_8.1: @F.1.%Self (%Self.1) = param self
// CHECK:STDOUT: %self.loc12_8.2: @F.1.%Self (%Self.1) = bind_name self, %self.loc12_8.1
// CHECK:STDOUT: %Self.ref.loc12_23: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_23.1: type = facet_type_access %Self.ref.loc12_23 [symbolic = @F.1.%Self (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_23.2: type = converted %Self.ref.loc12_23, %.loc12_23.1 [symbolic = @F.1.%Self (constants.%Self.1)]
// CHECK:STDOUT: %x.loc12_20.1: @F.1.%Self (%Self.1) = param x
// CHECK:STDOUT: %x.loc12_20.2: @F.1.%Self (%Self.1) = bind_name x, %x.loc12_20.1
// CHECK:STDOUT: %Self.ref.loc12_32: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_32.1: type = facet_type_access %Self.ref.loc12_32 [symbolic = @F.1.%Self (constants.%Self.1)]
// CHECK:STDOUT: %.loc12_32.2: type = converted %Self.ref.loc12_32, %.loc12_32.1 [symbolic = @F.1.%Self (constants.%Self.1)]
// CHECK:STDOUT: %return.var: ref %Self.1 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc12_36: %.3 = assoc_entity element0, %F.decl [template = constants.%.4]
@@ -140,22 +141,22 @@ impl D as SelfNested {
// CHECK:STDOUT: interface @SelfNested {
// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 0 [symbolic = constants.%Self.2]
// CHECK:STDOUT: %F.decl: %F.type.4 = fn_decl @F.4 [template = constants.%F.4] {
// CHECK:STDOUT: %Self.ref.loc28_12: %.9 = name_ref Self, %Self [symbolic = %Self.ref.loc28_12 (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_16.1: type = facet_type_access %Self.ref.loc28_12 [symbolic = %Self.ref.loc28_12 (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_16.2: type = converted %Self.ref.loc28_12, %.loc28_16.1 [symbolic = %Self.ref.loc28_12 (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_16.3: type = ptr_type %Self.2 [symbolic = %.loc28_16.3 (constants.%.10)]
// CHECK:STDOUT: %Self.ref.loc28_24: %.9 = name_ref Self, %Self [symbolic = %Self.ref.loc28_12 (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_24.1: type = facet_type_access %Self.ref.loc28_24 [symbolic = %Self.ref.loc28_12 (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_24.2: type = converted %Self.ref.loc28_24, %.loc28_24.1 [symbolic = %Self.ref.loc28_12 (constants.%Self.2)]
// CHECK:STDOUT: %Self.ref.loc28_12: %.9 = name_ref Self, %Self [symbolic = @F.4.%Self (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_16.1: type = facet_type_access %Self.ref.loc28_12 [symbolic = @F.4.%Self (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_16.2: type = converted %Self.ref.loc28_12, %.loc28_16.1 [symbolic = @F.4.%Self (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_16.3: type = ptr_type %Self.2 [symbolic = @F.4.%.1 (constants.%.10)]
// CHECK:STDOUT: %Self.ref.loc28_24: %.9 = name_ref Self, %Self [symbolic = @F.4.%Self (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_24.1: type = facet_type_access %Self.ref.loc28_24 [symbolic = @F.4.%Self (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_24.2: type = converted %Self.ref.loc28_24, %.loc28_24.1 [symbolic = @F.4.%Self (constants.%Self.2)]
// CHECK:STDOUT: %.loc28_35.1: %.2 = tuple_literal ()
// CHECK:STDOUT: %.loc28_35.2: type = converted %.loc28_35.1, constants.%.2 [template = constants.%.2]
// CHECK:STDOUT: %.loc28_36: type = struct_type {.x: %Self.2, .y: %.2} [symbolic = %.loc28_36 (constants.%.11)]
// CHECK:STDOUT: %.loc28_36: type = struct_type {.x: %Self.2, .y: %.2} [symbolic = @F.4.%.2 (constants.%.11)]
// CHECK:STDOUT: %.loc28_37.1: %.12 = tuple_literal (%.loc28_16.3, %.loc28_36)
// CHECK:STDOUT: %.loc28_37.2: type = converted %.loc28_37.1, constants.%.13 [symbolic = %.loc28_37.2 (constants.%.13)]
// CHECK:STDOUT: %x.loc28_8.1: @SelfNested.%.loc28_37.2 (%.13) = param x
// CHECK:STDOUT: %x.loc28_8.2: @SelfNested.%.loc28_37.2 (%.13) = bind_name x, %x.loc28_8.1
// CHECK:STDOUT: %.loc28_37.2: type = converted %.loc28_37.1, constants.%.13 [symbolic = @F.4.%.3 (constants.%.13)]
// CHECK:STDOUT: %x.loc28_8.1: @F.4.%.3 (%.13) = param x
// CHECK:STDOUT: %x.loc28_8.2: @F.4.%.3 (%.13) = bind_name x, %x.loc28_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc28_39: %.14 = assoc_entity element0, %F.decl [template = constants.%.15]
// CHECK:STDOUT: %.loc28_39: %.15 = assoc_entity element0, %F.decl [template = constants.%.16]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
@@ -202,17 +203,17 @@ impl D as SelfNested {
// CHECK:STDOUT: impl @impl.3: %C as %.9 {
// CHECK:STDOUT: %F.decl: %F.type.5 = fn_decl @F.5 [template = constants.%F.5] {
// CHECK:STDOUT: %C.ref.loc32_12: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %.loc32_13: type = ptr_type %C [template = constants.%.16]
// CHECK:STDOUT: %.loc32_13: type = ptr_type %C [template = constants.%.17]
// CHECK:STDOUT: %C.ref.loc32_21: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %.loc32_29.1: %.2 = tuple_literal ()
// CHECK:STDOUT: %.loc32_29.2: type = converted %.loc32_29.1, constants.%.2 [template = constants.%.2]
// CHECK:STDOUT: %.loc32_30: type = struct_type {.x: %C, .y: %.2} [template = constants.%.17]
// CHECK:STDOUT: %.loc32_30: type = struct_type {.x: %C, .y: %.2} [template = constants.%.18]
// CHECK:STDOUT: %.loc32_31.1: %.12 = tuple_literal (%.loc32_13, %.loc32_30)
// CHECK:STDOUT: %.loc32_31.2: type = converted %.loc32_31.1, constants.%.18 [template = constants.%.18]
// CHECK:STDOUT: %x.loc32_8.1: %.18 = param x
// CHECK:STDOUT: %x.loc32_8.2: %.18 = bind_name x, %x.loc32_8.1
// CHECK:STDOUT: %.loc32_31.2: type = converted %.loc32_31.1, constants.%.19 [template = constants.%.19]
// CHECK:STDOUT: %x.loc32_8.1: %.19 = param x
// CHECK:STDOUT: %x.loc32_8.2: %.19 = bind_name x, %x.loc32_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.1: <witness> = interface_witness (%F.decl) [template = constants.%.19]
// CHECK:STDOUT: %.1: <witness> = interface_witness (%F.decl) [template = constants.%.20]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .F = %F.decl
@@ -222,17 +223,17 @@ impl D as SelfNested {
// CHECK:STDOUT: impl @impl.4: %D as %.9 {
// CHECK:STDOUT: %F.decl: %F.type.6 = fn_decl @F.6 [template = constants.%F.6] {
// CHECK:STDOUT: %Self.ref.loc36_12: type = name_ref Self, constants.%D [template = constants.%D]
// CHECK:STDOUT: %.loc36_16: type = ptr_type %D [template = constants.%.20]
// CHECK:STDOUT: %.loc36_16: type = ptr_type %D [template = constants.%.21]
// CHECK:STDOUT: %Self.ref.loc36_24: type = name_ref Self, constants.%D [template = constants.%D]
// CHECK:STDOUT: %.loc36_35.1: %.2 = tuple_literal ()
// CHECK:STDOUT: %.loc36_35.2: type = converted %.loc36_35.1, constants.%.2 [template = constants.%.2]
// CHECK:STDOUT: %.loc36_36: type = struct_type {.x: %D, .y: %.2} [template = constants.%.21]
// CHECK:STDOUT: %.loc36_36: type = struct_type {.x: %D, .y: %.2} [template = constants.%.22]
// CHECK:STDOUT: %.loc36_37.1: %.12 = tuple_literal (%.loc36_16, %.loc36_36)
// CHECK:STDOUT: %.loc36_37.2: type = converted %.loc36_37.1, constants.%.22 [template = constants.%.22]
// CHECK:STDOUT: %x.loc36_8.1: %.22 = param x
// CHECK:STDOUT: %x.loc36_8.2: %.22 = bind_name x, %x.loc36_8.1
// CHECK:STDOUT: %.loc36_37.2: type = converted %.loc36_37.1, constants.%.23 [template = constants.%.23]
// CHECK:STDOUT: %x.loc36_8.1: %.23 = param x
// CHECK:STDOUT: %x.loc36_8.2: %.23 = bind_name x, %x.loc36_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.1: <witness> = interface_witness (%F.decl) [template = constants.%.23]
// CHECK:STDOUT: %.1: <witness> = interface_witness (%F.decl) [template = constants.%.24]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .F = %F.decl
@@ -249,8 +250,11 @@ impl D as SelfNested {
// CHECK:STDOUT: .Self = constants.%D
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1[@UseSelf.%self.loc12_8.2: @UseSelf.%Self.ref.loc12_14 (%Self.1)](@UseSelf.%x.loc12_20.2: @UseSelf.%Self.ref.loc12_14 (%Self.1)) -> %Self.1
// CHECK:STDOUT: generic [@UseSelf.%Self: %.1];
// CHECK:STDOUT: generic fn @F.1(@UseSelf.%Self: %.1) {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[@UseSelf.%self.loc12_8.2: @F.1.%Self (%Self.1)](@UseSelf.%x.loc12_20.2: @F.1.%Self (%Self.1)) -> %Self.1;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2[@impl.1.%self.loc20_8.2: %C](@impl.1.%x.loc20_17.2: %C) -> @impl.1.%return.var: %C {
// CHECK:STDOUT: !entry:
@@ -268,24 +272,27 @@ impl D as SelfNested {
// CHECK:STDOUT: return %.loc24_48 to @impl.2.%return.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.4(@SelfNested.%x.loc28_8.2: @SelfNested.%.loc28_37.2 (%.13))
// CHECK:STDOUT: generic [@SelfNested.%Self: %.9];
// CHECK:STDOUT: generic fn @F.4(@SelfNested.%Self: %.9) {
// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)]
// CHECK:STDOUT: %.1: type = ptr_type @F.4.%Self (%Self.2) [symbolic = %.1 (constants.%.10)]
// CHECK:STDOUT: %.2: type = struct_type {.x: @F.4.%Self (%Self.2), .y: %.2} [symbolic = %.2 (constants.%.11)]
// CHECK:STDOUT: %.3: type = tuple_type (@F.4.%.1 (%.10), @F.4.%.2 (%.11)) [symbolic = %.3 (constants.%.13)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.5(@impl.3.%x.loc32_8.2: %.18);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.6(@impl.4.%x.loc36_8.2: %.22);
// CHECK:STDOUT:
// CHECK:STDOUT: specific @UseSelf.%F.decl(constants.%Self.1) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @UseSelf.%Self.ref.loc12_14 => constants.%Self.1
// CHECK:STDOUT: fn(@SelfNested.%x.loc28_8.2: @F.4.%.3 (%.13));
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @SelfNested.%F.decl(constants.%Self.2) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @SelfNested.%Self.ref.loc28_12 => constants.%Self.2
// CHECK:STDOUT: @SelfNested.%.loc28_16.3 => constants.%.10
// CHECK:STDOUT: <unexpected>.inst+86.loc28_21 => <unexpected>.inst+87
// CHECK:STDOUT: @SelfNested.%.loc28_36 => constants.%.11
// CHECK:STDOUT: @SelfNested.%.loc28_37.2 => constants.%.13
// CHECK:STDOUT: fn @F.5(@impl.3.%x.loc32_8.2: %.19);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.6(@impl.4.%x.loc36_8.2: %.23);
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.1(constants.%Self.1) {
// CHECK:STDOUT: %Self => constants.%Self.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.4(constants.%Self.2) {
// CHECK:STDOUT: %Self => constants.%Self.2
// CHECK:STDOUT: %.1 => constants.%.10
// CHECK:STDOUT: %.2 => constants.%.11
// CHECK:STDOUT: %.3 => constants.%.14
// CHECK:STDOUT: }
// CHECK:STDOUT: