Skip to content

Commit

Permalink
Restore pretty-printing of param names
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffromer committed Oct 21, 2024
1 parent df95dff commit 2d3cc0a
Show file tree
Hide file tree
Showing 334 changed files with 4,038 additions and 4,008 deletions.
4 changes: 3 additions & 1 deletion toolchain/check/import_ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,9 @@ class ImportRefResolver {

auto new_param_id = context_.AddInstInNoBlock<SemIR::Param>(
AddImportIRInst(param_id),
{.type_id = type_id, .runtime_index = param_inst.runtime_index});
{.type_id = type_id,
.runtime_index = param_inst.runtime_index,
.pretty_name = GetLocalNameId(param_inst.pretty_name)});
switch (bind_inst.kind) {
case SemIR::BindName::Kind: {
auto entity_name_id = context_.entity_names().Add(
Expand Down
28 changes: 23 additions & 5 deletions toolchain/check/pattern_match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@
namespace Carbon::Check {
namespace {

// Returns a best-effort name for the given ParamPattern, suitable for use in
// IR pretty-printing.
// TODO: Resolve overlap with SemIR::Function::ParamPatternInfo::GetNameId
auto GetPrettyName(Context& context, SemIR::ParamPattern param_pattern)
-> SemIR::NameId {
if (context.insts().Is<SemIR::ReturnSlotPattern>(
param_pattern.subpattern_id)) {
return SemIR::NameId::ReturnSlot;
}
if (auto binding_pattern = context.insts().TryGetAs<SemIR::AnyBindingPattern>(
param_pattern.subpattern_id)) {
return context.entity_names().Get(binding_pattern->entity_name_id).name_id;
}
return SemIR::NameId::Invalid;
}

// Selects between the different kinds of pattern matching.
enum class MatchKind {
// Caller pattern matching occurs on the caller side of a function call, and
Expand Down Expand Up @@ -225,11 +241,13 @@ auto EmitPatternMatch(Context& context, MatchContext& match,
context.ReplaceInstBeforeConstantUse(entry.pattern_id,
param_pattern);
}
match.AddWork({.pattern_id = param_pattern.subpattern_id,
.scrutinee_id = context.AddInst<SemIR::Param>(
pattern.loc_id,
{.type_id = param_pattern.type_id,
.runtime_index = param_pattern.runtime_index})});
match.AddWork(
{.pattern_id = param_pattern.subpattern_id,
.scrutinee_id = context.AddInst<SemIR::Param>(
pattern.loc_id,
{.type_id = param_pattern.type_id,
.runtime_index = param_pattern.runtime_index,
.pretty_name = GetPrettyName(context, param_pattern)})});
} break;
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ fn F() -> {} {
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc13_12.1: %.1 = struct_literal ()
// CHECK:STDOUT: %.loc13_12.2: type = converted %.loc13_12.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %param: %.1 = param runtime_param0
// CHECK:STDOUT: %return: ref %.1 = return_slot %param
// CHECK:STDOUT: %return.param: %.1 = param runtime_param0
// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/alias/no_prelude/fail_params.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ alias A(T:! type) = T*;
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %.loc18: type = ptr_type %T [symbolic = constants.%.1]
// CHECK:STDOUT: %param: type = param runtime_param<invalid>
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %param [symbolic = constants.%T]
// CHECK:STDOUT: %T.param: type = param runtime_param<invalid>
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T]
// CHECK:STDOUT: %A: <error> = bind_alias A, <error> [template = <error>]
// CHECK:STDOUT: }
// CHECK:STDOUT:
4 changes: 2 additions & 2 deletions toolchain/check/testdata/alias/no_prelude/in_namespace.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ fn F() -> NS.a {
// CHECK:STDOUT: } {
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
// CHECK:STDOUT: %a.ref: type = name_ref a, file.%a [template = constants.%C]
// CHECK:STDOUT: %param: %C = param runtime_param0
// CHECK:STDOUT: %return: ref %C = return_slot %param
// CHECK:STDOUT: %return.param: %C = param runtime_param0
// CHECK:STDOUT: %return: ref %C = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/alias/no_prelude/local.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ fn F() -> () {
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc11_12.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc11_12.2: type = converted %.loc11_12.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %param: %.1 = param runtime_param0
// CHECK:STDOUT: %return: ref %.1 = return_slot %param
// CHECK:STDOUT: %return.param: %.1 = param runtime_param0
// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/array/array_in_place.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ fn G() {
// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32]
// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_32.loc11_22, %.loc11_25.6 [template = i32]
// CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %param: %.3 = param runtime_param0
// CHECK:STDOUT: %return: ref %.3 = return_slot %param
// CHECK:STDOUT: %return.param: %.3 = param runtime_param0
// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {}
// CHECK:STDOUT: }
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/array/assign_return_value.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ fn Run() {
// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_32, %.loc11_16.2 [template = i32]
// CHECK:STDOUT: %.loc11_16.4: type = converted %.loc11_16.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %param: %.3 = param runtime_param0
// CHECK:STDOUT: %return: ref %.3 = return_slot %param
// CHECK:STDOUT: %return.param: %.3 = param runtime_param0
// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {}
// CHECK:STDOUT: }
Expand Down
12 changes: 6 additions & 6 deletions toolchain/check/testdata/array/canonicalize_index.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ let b: [i32; 3]* = &a;
// CHECK:STDOUT: %int.make_type_32.loc11_27: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32.loc11_27 [template = i32]
// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32]
// CHECK:STDOUT: %param.loc11_9: i32 = param runtime_param0
// CHECK:STDOUT: %a: i32 = bind_name a, %param.loc11_9
// CHECK:STDOUT: %param.loc11_17: i32 = param runtime_param1
// CHECK:STDOUT: %b: i32 = bind_name b, %param.loc11_17
// CHECK:STDOUT: %param.loc11_24: i32 = param runtime_param2
// CHECK:STDOUT: %return: ref i32 = return_slot %param.loc11_24
// CHECK:STDOUT: %a.param: i32 = param runtime_param0
// CHECK:STDOUT: %a: i32 = bind_name a, %a.param
// CHECK:STDOUT: %b.param: i32 = param runtime_param1
// CHECK:STDOUT: %b: i32 = bind_name b, %b.param
// CHECK:STDOUT: %return.param: i32 = param runtime_param2
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add]
Expand Down
8 changes: 4 additions & 4 deletions toolchain/check/testdata/array/fail_bound_negative.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ var a: [i32; Negate(1)];
// CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32]
// CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_32.loc11_22, %.loc11_22.1 [template = i32]
// CHECK:STDOUT: %param.loc11_12: i32 = param runtime_param0
// CHECK:STDOUT: %n: i32 = bind_name n, %param.loc11_12
// CHECK:STDOUT: %param.loc11_19: i32 = param runtime_param1
// CHECK:STDOUT: %return: ref i32 = return_slot %param.loc11_19
// CHECK:STDOUT: %n.param: i32 = param runtime_param0
// CHECK:STDOUT: %n: i32 = bind_name n, %n.param
// CHECK:STDOUT: %return.param: i32 = param runtime_param1
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate]
Expand Down
16 changes: 8 additions & 8 deletions toolchain/check/testdata/array/function_param.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ fn G() -> i32 {
// CHECK:STDOUT: %int.make_type_32.loc11_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_32.1: type = value_of_initializer %int.make_type_32.loc11_32 [template = i32]
// CHECK:STDOUT: %.loc11_32.2: type = converted %int.make_type_32.loc11_32, %.loc11_32.1 [template = i32]
// CHECK:STDOUT: %param.loc11_9: %.3 = param runtime_param0
// CHECK:STDOUT: %arr: %.3 = bind_name arr, %param.loc11_9
// CHECK:STDOUT: %param.loc11_22: i32 = param runtime_param1
// CHECK:STDOUT: %i: i32 = bind_name i, %param.loc11_22
// CHECK:STDOUT: %param.loc11_29: i32 = param runtime_param2
// CHECK:STDOUT: %return: ref i32 = return_slot %param.loc11_29
// CHECK:STDOUT: %arr.param: %.3 = param runtime_param0
// CHECK:STDOUT: %arr: %.3 = bind_name arr, %arr.param
// CHECK:STDOUT: %i.param: i32 = param runtime_param1
// CHECK:STDOUT: %i: i32 = bind_name i, %i.param
// CHECK:STDOUT: %return.param: i32 = param runtime_param2
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern
Expand All @@ -91,8 +91,8 @@ fn G() -> i32 {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc15_11.2: type = converted %int.make_type_32, %.loc15_11.1 [template = i32]
// CHECK:STDOUT: %param: i32 = param runtime_param0
// CHECK:STDOUT: %return: ref i32 = return_slot %param
// CHECK:STDOUT: %return.param: i32 = param runtime_param0
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/array/generic_empty.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ fn G(T:! type) {
// CHECK:STDOUT: %T.patt.loc11_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc11_6.1, runtime_param<invalid> [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %param: type = param runtime_param<invalid>
// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc11_6.2 (constants.%T)]
// CHECK:STDOUT: %T.param: type = param runtime_param<invalid>
// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/as/adapter_conversion.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ var b: B = {.x = 1} as B;
// CHECK:STDOUT: %return.param_patt: %A = param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %param: %A = param runtime_param0
// CHECK:STDOUT: %return: ref %A = return_slot %param
// CHECK:STDOUT: %return.param: %A = param runtime_param0
// CHECK:STDOUT: %return: ref %A = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc11: <witness> = complete_type_witness %.3 [template = constants.%.4]
// CHECK:STDOUT:
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/as/basic.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ fn Main() -> i32 {
// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32]
// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11, %.loc11_14.1 [template = i32]
// CHECK:STDOUT: %param: i32 = param runtime_param0
// CHECK:STDOUT: %return: ref i32 = return_slot %param
// CHECK:STDOUT: %return.param: i32 = param runtime_param0
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
12 changes: 6 additions & 6 deletions toolchain/check/testdata/as/identity.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,25 @@ fn Initializing() {
// CHECK:STDOUT: %n.param_patt: %X = param_pattern %n.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %X.ref.loc17: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %param: %X = param runtime_param0
// CHECK:STDOUT: %n: %X = bind_name n, %param
// CHECK:STDOUT: %n.param: %X = param runtime_param0
// CHECK:STDOUT: %n: %X = bind_name n, %n.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Reference.decl: %Reference.type = fn_decl @Reference [template = constants.%Reference] {
// CHECK:STDOUT: %p.patt: %.5 = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %.5 = param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %X.ref.loc21: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %.loc21: type = ptr_type %X [template = constants.%.5]
// CHECK:STDOUT: %param: %.5 = param runtime_param0
// CHECK:STDOUT: %p: %.5 = bind_name p, %param
// CHECK:STDOUT: %p.param: %.5 = param runtime_param0
// CHECK:STDOUT: %p: %.5 = bind_name p, %p.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {
// CHECK:STDOUT: %return.patt: %X = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %X = param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %param: %X = param runtime_param0
// CHECK:STDOUT: %return: ref %X = return_slot %param
// CHECK:STDOUT: %return.param: %X = param runtime_param0
// CHECK:STDOUT: %return: ref %X = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Initializing.decl: %Initializing.type = fn_decl @Initializing [template = constants.%Initializing] {} {}
// CHECK:STDOUT: }
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/as/no_prelude/tuple.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ fn Var() {
// CHECK:STDOUT: %return.param_patt: %X = param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %param: %X = param runtime_param0
// CHECK:STDOUT: %return: ref %X = return_slot %param
// CHECK:STDOUT: %return.param: %X = param runtime_param0
// CHECK:STDOUT: %return: ref %X = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Let.decl: %Let.type = fn_decl @Let [template = constants.%Let] {} {}
// CHECK:STDOUT: %Var.decl: %Var.type = fn_decl @Var [template = constants.%Var] {} {}
Expand Down
16 changes: 8 additions & 8 deletions toolchain/check/testdata/as/overloaded.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ let n: i32 = ((4 as i32) as X) as i32;
// CHECK:STDOUT: %.loc16_20.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc16_20.2: type = converted %int.make_type_32, %.loc16_20.1 [template = i32]
// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %param.loc16_18: i32 = param runtime_param0
// CHECK:STDOUT: %self: i32 = bind_name self, %param.loc16_18
// CHECK:STDOUT: %param.loc16_27: %X = param runtime_param1
// CHECK:STDOUT: %return: ref %X = return_slot %param.loc16_27
// CHECK:STDOUT: %self.param: i32 = param runtime_param0
// CHECK:STDOUT: %self: i32 = bind_name self, %self.param
// CHECK:STDOUT: %return.param: %X = param runtime_param1
// CHECK:STDOUT: %return: ref %X = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc15_24: <witness> = interface_witness (%Convert.decl) [template = constants.%.9]
// CHECK:STDOUT:
Expand All @@ -172,10 +172,10 @@ let n: i32 = ((4 as i32) as X) as i32;
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc20_28.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc20_28.2: type = converted %int.make_type_32, %.loc20_28.1 [template = i32]
// CHECK:STDOUT: %param.loc20_18: %X = param runtime_param0
// CHECK:STDOUT: %self: %X = bind_name self, %param.loc20_18
// CHECK:STDOUT: %param.loc20_25: i32 = param runtime_param1
// CHECK:STDOUT: %return: ref i32 = return_slot %param.loc20_25
// CHECK:STDOUT: %self.param: %X = param runtime_param0
// CHECK:STDOUT: %self: %X = bind_name self, %self.param
// CHECK:STDOUT: %return.param: i32 = param runtime_param1
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc19_24: <witness> = interface_witness (%Convert.decl) [template = constants.%.13]
// CHECK:STDOUT:
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/basics/fail_bad_run.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ fn Run() -> String {}
// CHECK:STDOUT: %return.patt: String = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: String = param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %param: String = param runtime_param0
// CHECK:STDOUT: %return: ref String = return_slot %param
// CHECK:STDOUT: %return.param: String = param runtime_param0
// CHECK:STDOUT: %return: ref String = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/basics/fail_bad_run_2.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ fn Run(n: i32) {}
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32, %.loc14_11.1 [template = i32]
// CHECK:STDOUT: %param: i32 = param runtime_param0
// CHECK:STDOUT: %n: i32 = bind_name n, %param
// CHECK:STDOUT: %n.param: i32 = param runtime_param0
// CHECK:STDOUT: %n: i32 = bind_name n, %n.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ fn Foo(n: ()) -> ((), ()) {
// CHECK:STDOUT: 'inst+13': {kind: Converted, arg0: inst+10, arg1: inst+9, type: typeTypeType}
// CHECK:STDOUT: 'inst+14': {kind: ReturnSlotPattern, type: type(inst+9)}
// CHECK:STDOUT: 'inst+15': {kind: ParamPattern, arg0: inst+14, arg1: runtime_param1, type: type(inst+9)}
// CHECK:STDOUT: 'inst+16': {kind: Param, arg0: runtime_param0, type: type(inst+1)}
// CHECK:STDOUT: 'inst+17': {kind: Param, arg0: runtime_param1, type: type(inst+9)}
// CHECK:STDOUT: 'inst+16': {kind: Param, arg0: runtime_param0, arg1: name1, type: type(inst+1)}
// CHECK:STDOUT: 'inst+17': {kind: Param, arg0: runtime_param1, arg1: nameReturnSlot, type: type(inst+9)}
// CHECK:STDOUT: 'inst+18': {kind: ReturnSlot, arg0: inst+17, type: type(inst+9)}
// CHECK:STDOUT: 'inst+19': {kind: FunctionDecl, arg0: function0, arg1: block8, type: type(inst+20)}
// CHECK:STDOUT: 'inst+20': {kind: FunctionType, arg0: function0, arg1: specific<invalid>, type: typeTypeType}
Expand Down Expand Up @@ -192,10 +192,10 @@ fn Foo(n: ()) -> ((), ()) {
// CHECK:STDOUT: %.loc15_25.2: type = converted %.loc15_20, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %.loc15_25.3: type = converted %.loc15_24, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %.loc15_25.4: type = converted %.loc15_25.1, constants.%.2 [template = constants.%.2]
// CHECK:STDOUT: %param.loc15_9: %.1 = param runtime_param0
// CHECK:STDOUT: %n: %.1 = bind_name n, %param.loc15_9
// CHECK:STDOUT: %param.loc15_15: %.2 = param runtime_param1
// CHECK:STDOUT: %return: ref %.2 = return_slot %param.loc15_15
// CHECK:STDOUT: %n.param: %.1 = param runtime_param0
// CHECK:STDOUT: %n: %.1 = bind_name n, %n.param
// CHECK:STDOUT: %return.param: %.2 = param runtime_param1
// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
Loading

0 comments on commit 2d3cc0a

Please sign in to comment.