Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build an evaluation block for the definition region of a generic. #4131

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions toolchain/check/generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,16 @@ static auto MakeGenericEvalBlock(Context& context, SemIR::GenericId generic_id,
if ((dep_kind & GenericRegionStack::DependencyKind::SymbolicType) !=
GenericRegionStack::DependencyKind::None) {
auto inst = context.insts().Get(inst_id);
inst.SetType(AddGenericTypeToEvalBlock(
context, generic_id, region, constants_in_generic, inst.type_id()));
auto type_id = AddGenericTypeToEvalBlock(
context, generic_id, region, constants_in_generic, inst.type_id());
// TODO: Eventually, completeness requirements should be modeled as
// constraints on the generic rather than properties of the type. For now,
// require the transformed type to be complete if the original was.
// TODO: We'll also need to do this when evaluating the eval block.
if (context.types().IsComplete(inst.type_id())) {
context.TryToCompleteType(type_id);
}
inst.SetType(type_id);
context.sem_ir().insts().Set(inst_id, inst);
}

Expand Down Expand Up @@ -231,7 +239,10 @@ auto FinishGenericDefinition(Context& context, SemIR::GenericId generic_id)
return;
}

// TODO: Track the list of dependent instructions in this region.
auto definition_block_id = MakeGenericEvalBlock(
context, generic_id, SemIR::GenericInstIndex::Region::Definition);
context.generics().Get(generic_id).definition_block_id = definition_block_id;

context.generic_region_stack().Pop();
}

Expand Down
13 changes: 7 additions & 6 deletions toolchain/check/testdata/array/generic_empty.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fn G(T:! type) {
// CHECK:STDOUT: %.3: type = array_type %.2, %T [symbolic]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic]
// CHECK:STDOUT: %array: %.3 = tuple_value () [symbolic]
// CHECK:STDOUT: %.5: type = ptr_type @G.%.loc13_17 (%.3) [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand All @@ -42,14 +43,14 @@ fn G(T:! type) {
// CHECK:STDOUT: fn @G(%T: type)
// CHECK:STDOUT: generic [%T: type] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = %T.ref (constants.%T)]
// CHECK:STDOUT: %.loc13_16: i32 = int_literal 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_17: type = array_type %.loc13_16, %T [symbolic = constants.%.3]
// CHECK:STDOUT: %arr.var: ref %.3 = var arr
// CHECK:STDOUT: %arr: ref %.3 = bind_name arr, %arr.var
// CHECK:STDOUT: %.loc13_17: type = array_type %.loc13_16, %T [symbolic = %.loc13_17 (constants.%.3)]
// CHECK:STDOUT: %arr.var: ref @G.%.loc13_17 (%.3) = var arr
// CHECK:STDOUT: %arr: ref @G.%.loc13_17 (%.3) = bind_name arr, %arr.var
// CHECK:STDOUT: %.loc13_22.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc13_22.2: init %.3 = array_init () to %arr.var [symbolic = constants.%array]
// CHECK:STDOUT: %.loc13_23: init %.3 = converted %.loc13_22.1, %.loc13_22.2 [symbolic = constants.%array]
// CHECK:STDOUT: %.loc13_22.2: init @G.%.loc13_17 (%.3) = array_init () to %arr.var [symbolic = %.loc13_22.2 (constants.%array)]
// CHECK:STDOUT: %.loc13_23: init @G.%.loc13_17 (%.3) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %.loc13_22.2 (constants.%array)]
// CHECK:STDOUT: assign %arr.var, %.loc13_23
// CHECK:STDOUT: return
// CHECK:STDOUT: }
Expand Down
9 changes: 7 additions & 2 deletions toolchain/check/testdata/class/fail_generic_method.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ fn Class(N:! i32).F[self: Self](n: T) {}
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class
// CHECK:STDOUT: generic [file.%T.loc11_13.2: type] {
// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, file.%T.loc11_13.2 [symbolic = constants.%T]
// CHECK:STDOUT: %.loc12: %.2 = field_decl a, element0 [template]
// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T.ref.loc12 (constants.%T)]
// CHECK:STDOUT: %.loc12: <unexpected instref inst+28> (%.2) = field_decl a, element0 [template]
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %.loc13: type = specific_constant constants.%Class.2, file.%Class.decl(constants.%T) [symbolic = %.loc13 (constants.%Class.2)]
// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc13 [symbolic = %.loc13 (constants.%Class.2)]
Expand Down Expand Up @@ -122,6 +122,11 @@ fn Class(N:! i32).F[self: Self](n: T) {}
// CHECK:STDOUT: @Class.%T.ref.loc13 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%Class.decl(@Class.%T.ref.loc12) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%T.loc11_13.2 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%.decl(constants.%N) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%N.loc32_10.2 => constants.%N
Expand Down
9 changes: 7 additions & 2 deletions toolchain/check/testdata/class/generic/basic.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class Class(T:! type) {
// CHECK:STDOUT: %T.ref.loc17: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T.ref.loc17 (constants.%T)]
// CHECK:STDOUT: %return.var.loc17: ref %T = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.ref.loc21: type = name_ref T, file.%T.loc11_13.2 [symbolic = constants.%T]
// CHECK:STDOUT: %.loc21: %.4 = field_decl k, element0 [template]
// CHECK:STDOUT: %T.ref.loc21: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T.ref.loc21 (constants.%T)]
// CHECK:STDOUT: %.loc21: <unexpected instref inst+41> (%.4) = field_decl k, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%Class.2
Expand Down Expand Up @@ -125,3 +125,8 @@ class Class(T:! type) {
// CHECK:STDOUT: @Class.%T.ref.loc17 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%Class.decl(@Class.%T.ref.loc21) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%T.loc11_13.2 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
9 changes: 7 additions & 2 deletions toolchain/check/testdata/class/generic/fail_todo_use.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ fn Run() -> i32 {
// CHECK:STDOUT: %.loc12_34: type = ptr_type %T [symbolic = %.loc12_34 (constants.%.3)]
// CHECK:STDOUT: %return.var: ref %.3 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.ref.loc16: type = name_ref T, file.%T.loc11_13.2 [symbolic = constants.%T]
// CHECK:STDOUT: %.loc16: %.4 = field_decl k, element0 [template]
// CHECK:STDOUT: %T.ref.loc16: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T.ref.loc16 (constants.%T)]
// CHECK:STDOUT: %.loc16: <unexpected instref inst+32> (%.4) = field_decl k, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%Class.2
Expand Down Expand Up @@ -156,6 +156,11 @@ fn Run() -> i32 {
// CHECK:STDOUT: @Class.%.loc12_34 => constants.%.3
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%Class.decl(@Class.%T.ref.loc16) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%T.loc11_13.2 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%Class.decl(i32) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%T.loc11_13.2 => i32
Expand Down
18 changes: 14 additions & 4 deletions toolchain/check/testdata/class/generic/field.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ fn H(U:! type, c: Class(U)) -> U {
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class
// CHECK:STDOUT: generic [file.%T.loc2_13.2: type] {
// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc2_13.2 [symbolic = constants.%T]
// CHECK:STDOUT: %.loc3: %.2 = field_decl x, element0 [template]
// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc2_13.2 [symbolic = %T.ref (constants.%T)]
// CHECK:STDOUT: %.loc3: <unexpected instref inst+18> (%.2) = field_decl x, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%Class.2
Expand All @@ -118,6 +118,11 @@ fn H(U:! type, c: Class(U)) -> U {
// CHECK:STDOUT: file.%T.loc2_13.2 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%Class.decl(@Class.%T.ref) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%T.loc2_13.2 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%G.decl(constants.%T) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: @G.%T => constants.%T
Expand Down Expand Up @@ -196,8 +201,8 @@ fn H(U:! type, c: Class(U)) -> U {
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class
// CHECK:STDOUT: generic [file.%T.loc2_13.2: type] {
// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc2_13.2 [symbolic = constants.%T]
// CHECK:STDOUT: %.loc3: %.2 = field_decl x, element0 [template]
// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc2_13.2 [symbolic = %T.ref (constants.%T)]
// CHECK:STDOUT: %.loc3: <unexpected instref inst+18> (%.2) = field_decl x, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%Class.2
Expand Down Expand Up @@ -228,6 +233,11 @@ fn H(U:! type, c: Class(U)) -> U {
// CHECK:STDOUT: file.%T.loc2_13.2 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%Class.decl(@Class.%T.ref) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%T.loc2_13.2 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%Class.decl(i32) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%T.loc2_13.2 => i32
Expand Down
28 changes: 14 additions & 14 deletions toolchain/check/testdata/class/generic/self.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,23 @@ class Class(T:! type) {
// CHECK:STDOUT: generic [file.%T.loc11_13.2: type] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1]
// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_13.2 [symbolic = constants.%T]
// CHECK:STDOUT: %.loc17_17: init type = call %Class.ref(%T.ref) [symbolic = constants.%Class.2]
// CHECK:STDOUT: %.loc17_19.1: type = value_of_initializer %.loc17_17 [symbolic = constants.%Class.2]
// CHECK:STDOUT: %.loc17_19.2: type = converted %.loc17_17, %.loc17_19.1 [symbolic = constants.%Class.2]
// CHECK:STDOUT: %c.var: ref %Class.2 = var c
// CHECK:STDOUT: %c: ref %Class.2 = bind_name c, %c.var
// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T.ref (constants.%T)]
// CHECK:STDOUT: %.loc17_17: init type = call %Class.ref(%T.ref) [symbolic = %.loc17_17 (constants.%Class.2)]
// CHECK:STDOUT: %.loc17_19.1: type = value_of_initializer %.loc17_17 [symbolic = %.loc17_17 (constants.%Class.2)]
// CHECK:STDOUT: %.loc17_19.2: type = converted %.loc17_17, %.loc17_19.1 [symbolic = %.loc17_17 (constants.%Class.2)]
// CHECK:STDOUT: %c.var: ref @F.%.loc17_17 (%Class.2) = var c
// CHECK:STDOUT: %c: ref @F.%.loc17_17 (%Class.2) = bind_name c, %c.var
// CHECK:STDOUT: %MakeSelf.ref: %MakeSelf.type = name_ref MakeSelf, @Class.%MakeSelf.decl [template = constants.%MakeSelf]
// CHECK:STDOUT: %.loc17_9: ref %Class.2 = splice_block %c.var {}
// CHECK:STDOUT: %MakeSelf.call: init %Class.2 = call %MakeSelf.ref() to %.loc17_9
// CHECK:STDOUT: %.loc17_9: ref @F.%.loc17_17 (%Class.2) = splice_block %c.var {}
// CHECK:STDOUT: %MakeSelf.call: init @F.%.loc17_17 (%Class.2) = call %MakeSelf.ref() to %.loc17_9
// CHECK:STDOUT: assign %c.var, %MakeSelf.call
// CHECK:STDOUT: %.loc18_12: type = specific_constant constants.%Class.2, file.%Class.decl(constants.%T) [symbolic = constants.%Class.2]
// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc18_12 [symbolic = constants.%Class.2]
// CHECK:STDOUT: %s.var: ref %Class.2 = var s
// CHECK:STDOUT: %s: ref %Class.2 = bind_name s, %s.var
// CHECK:STDOUT: %.loc18_12: type = specific_constant constants.%Class.2, file.%Class.decl(constants.%T) [symbolic = %.loc17_17 (constants.%Class.2)]
// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc18_12 [symbolic = %.loc17_17 (constants.%Class.2)]
// CHECK:STDOUT: %s.var: ref @F.%.loc17_17 (%Class.2) = var s
// CHECK:STDOUT: %s: ref @F.%.loc17_17 (%Class.2) = bind_name s, %s.var
// CHECK:STDOUT: %MakeClass.ref: %MakeClass.type = name_ref MakeClass, @Class.%MakeClass.decl [template = constants.%MakeClass]
// CHECK:STDOUT: %.loc18_9: ref %Class.2 = splice_block %s.var {}
// CHECK:STDOUT: %MakeClass.call: init %Class.2 = call %MakeClass.ref() to %.loc18_9
// CHECK:STDOUT: %.loc18_9: ref @F.%.loc17_17 (%Class.2) = splice_block %s.var {}
// CHECK:STDOUT: %MakeClass.call: init @F.%.loc17_17 (%Class.2) = call %MakeClass.ref() to %.loc18_9
// CHECK:STDOUT: assign %s.var, %MakeClass.call
// CHECK:STDOUT: return
// CHECK:STDOUT: }
Expand Down
9 changes: 7 additions & 2 deletions toolchain/check/testdata/class/generic_method.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ fn Class(T:! type).F[self: Self](n: T) {}
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class
// CHECK:STDOUT: generic [file.%T.loc11_13.2: type] {
// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, file.%T.loc11_13.2 [symbolic = constants.%T]
// CHECK:STDOUT: %.loc12: %.2 = field_decl a, element0 [template]
// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T.ref.loc12 (constants.%T)]
// CHECK:STDOUT: %.loc12: <unexpected instref inst+28> (%.2) = field_decl a, element0 [template]
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %.loc13: type = specific_constant constants.%Class.2, file.%Class.decl(constants.%T) [symbolic = %.loc13 (constants.%Class.2)]
// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc13 [symbolic = %.loc13 (constants.%Class.2)]
Expand Down Expand Up @@ -91,3 +91,8 @@ fn Class(T:! type).F[self: Self](n: T) {}
// CHECK:STDOUT: @Class.%T.ref.loc13 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific file.%Class.decl(@Class.%T.ref.loc12) {
// CHECK:STDOUT: declaration:
// CHECK:STDOUT: file.%T.loc11_13.2 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
2 changes: 1 addition & 1 deletion toolchain/check/testdata/eval/fail_symbolic.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn G(N:! i32) {
// CHECK:STDOUT: generic [%N: i32] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N [symbolic = constants.%N]
// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N [symbolic = %N.ref (constants.%N)]
// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_32, %.loc16_11.1 [template = i32]
// CHECK:STDOUT: %.loc16_17: type = array_type %N.ref, i32 [template = <error>]
Expand Down
31 changes: 16 additions & 15 deletions toolchain/check/testdata/eval/symbolic.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fn F(T:! type) {
// CHECK:STDOUT: %.9: i32 = int_literal 5 [template]
// CHECK:STDOUT: %.10: type = array_type %.9, %T [symbolic]
// CHECK:STDOUT: %.11: type = ptr_type %.10 [symbolic]
// CHECK:STDOUT: %.12: type = ptr_type @F.%.loc15_15 (%.10) [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand All @@ -50,23 +51,23 @@ fn F(T:! type) {
// CHECK:STDOUT: fn @F(%T: type)
// CHECK:STDOUT: generic [%T: type] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %T.ref.loc13_11: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %.loc13_12: type = ptr_type %T [symbolic = constants.%.2]
// CHECK:STDOUT: %T.ref.loc13_21: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %.loc13_15: type = const_type %T [symbolic = constants.%.3]
// CHECK:STDOUT: %T.ref.loc13_11: type = name_ref T, %T [symbolic = %T.ref.loc13_11 (constants.%T)]
// CHECK:STDOUT: %.loc13_12: type = ptr_type %T [symbolic = %.loc13_12 (constants.%.2)]
// CHECK:STDOUT: %T.ref.loc13_21: type = name_ref T, %T [symbolic = %T.ref.loc13_11 (constants.%T)]
// CHECK:STDOUT: %.loc13_15: type = const_type %T [symbolic = %.loc13_15 (constants.%.3)]
// CHECK:STDOUT: %.loc13_22.1: %.4 = tuple_literal (%.loc13_12, %.loc13_15)
// CHECK:STDOUT: %.loc13_22.2: type = converted %.loc13_22.1, constants.%.5 [symbolic = constants.%.5]
// CHECK:STDOUT: %u.var: ref %.5 = var u
// CHECK:STDOUT: %u: ref %.5 = bind_name u, %u.var
// CHECK:STDOUT: %T.ref.loc14: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %.loc14: type = struct_type {.a: %T} [symbolic = constants.%.8]
// CHECK:STDOUT: %v.var: ref %.8 = var v
// CHECK:STDOUT: %v: ref %.8 = bind_name v, %v.var
// CHECK:STDOUT: %T.ref.loc15: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %.loc13_22.2: type = converted %.loc13_22.1, constants.%.5 [symbolic = %.loc13_22.2 (constants.%.5)]
// CHECK:STDOUT: %u.var: ref @F.%.loc13_22.2 (%.5) = var u
// CHECK:STDOUT: %u: ref @F.%.loc13_22.2 (%.5) = bind_name u, %u.var
// CHECK:STDOUT: %T.ref.loc14: type = name_ref T, %T [symbolic = %T.ref.loc13_11 (constants.%T)]
// CHECK:STDOUT: %.loc14: type = struct_type {.a: %T} [symbolic = %.loc14 (constants.%.8)]
// CHECK:STDOUT: %v.var: ref @F.%.loc14 (%.8) = var v
// CHECK:STDOUT: %v: ref @F.%.loc14 (%.8) = bind_name v, %v.var
// CHECK:STDOUT: %T.ref.loc15: type = name_ref T, %T [symbolic = %T.ref.loc13_11 (constants.%T)]
// CHECK:STDOUT: %.loc15_14: i32 = int_literal 5 [template = constants.%.9]
// CHECK:STDOUT: %.loc15_15: type = array_type %.loc15_14, %T [symbolic = constants.%.10]
// CHECK:STDOUT: %w.var: ref %.10 = var w
// CHECK:STDOUT: %w: ref %.10 = bind_name w, %w.var
// CHECK:STDOUT: %.loc15_15: type = array_type %.loc15_14, %T [symbolic = %.loc15_15 (constants.%.10)]
// CHECK:STDOUT: %w.var: ref @F.%.loc15_15 (%.10) = var w
// CHECK:STDOUT: %w: ref @F.%.loc15_15 (%.10) = bind_name w, %w.var
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ fn F(T:! type, U:! type) {
// CHECK:STDOUT: fn @F(%T: type, %U: type)
// CHECK:STDOUT: generic [%T: type, %U: type] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %.loc12: type = ptr_type %T [symbolic = constants.%.2]
// CHECK:STDOUT: %p.var: ref %.2 = var p
// CHECK:STDOUT: %p: ref %.2 = bind_name p, %p.var
// CHECK:STDOUT: %U.ref: type = name_ref U, %U [symbolic = constants.%U]
// CHECK:STDOUT: %p.ref: ref %.2 = name_ref p, %p
// CHECK:STDOUT: %.loc16_15: %.2 = bind_value %p.ref
// CHECK:STDOUT: %.loc16_14: ref %T = deref %.loc16_15
// CHECK:STDOUT: %n: %U = bind_name n, <error>
// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = %T.ref (constants.%T)]
// CHECK:STDOUT: %.loc12: type = ptr_type %T [symbolic = %.loc12 (constants.%.2)]
// CHECK:STDOUT: %p.var: ref @F.%.loc12 (%.2) = var p
// CHECK:STDOUT: %p: ref @F.%.loc12 (%.2) = bind_name p, %p.var
// CHECK:STDOUT: %U.ref: type = name_ref U, %U [symbolic = %U.ref (constants.%U)]
// CHECK:STDOUT: %p.ref: ref @F.%.loc12 (%.2) = name_ref p, %p
// CHECK:STDOUT: %.loc16_15: @F.%.loc12 (%.2) = bind_value %p.ref
// CHECK:STDOUT: %.loc16_14: ref @F.%T.ref (%T) = deref %.loc16_15
// CHECK:STDOUT: %n: @F.%U.ref (%U) = bind_name n, <error>
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ fn F(T:! type) {
// CHECK:STDOUT: fn @F(%T: type)
// CHECK:STDOUT: generic [%T: type] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %.loc12: type = ptr_type %T [symbolic = constants.%.2]
// CHECK:STDOUT: %p.var: ref %.2 = var p
// CHECK:STDOUT: %p: ref %.2 = bind_name p, %p.var
// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %p.ref: ref %.2 = name_ref p, %p
// CHECK:STDOUT: %.loc13_15: %.2 = bind_value %p.ref
// CHECK:STDOUT: %.loc13_14.1: ref %T = deref %.loc13_15
// CHECK:STDOUT: %.loc13_14.2: %T = bind_value %.loc13_14.1
// CHECK:STDOUT: %n: %T = bind_name n, %.loc13_14.2
// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, %T [symbolic = %T.ref.loc12 (constants.%T)]
// CHECK:STDOUT: %.loc12: type = ptr_type %T [symbolic = %.loc12 (constants.%.2)]
// CHECK:STDOUT: %p.var: ref @F.%.loc12 (%.2) = var p
// CHECK:STDOUT: %p: ref @F.%.loc12 (%.2) = bind_name p, %p.var
// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T [symbolic = %T.ref.loc12 (constants.%T)]
// CHECK:STDOUT: %p.ref: ref @F.%.loc12 (%.2) = name_ref p, %p
// CHECK:STDOUT: %.loc13_15: @F.%.loc12 (%.2) = bind_value %p.ref
// CHECK:STDOUT: %.loc13_14.1: ref @F.%T.ref.loc12 (%T) = deref %.loc13_15
// CHECK:STDOUT: %.loc13_14.2: @F.%T.ref.loc12 (%T) = bind_value %.loc13_14.1
// CHECK:STDOUT: %n: @F.%T.ref.loc12 (%T) = bind_name n, %.loc13_14.2
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
Loading
Loading