diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index fa48820bbaa6..b766e541745b 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -369,12 +369,6 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst) // are treated as the same value. return SemIR::ConstantId::ForSymbolicConstant(inst_id); - case SemIR::BindName::Kind: - // TODO: We need to look through `BindName`s for member accesses naming - // fields, where the member name is a `BindName`. Should we really be - // creating a `BindName` in that case? - return context.constant_values().Get(inst.As().value_id); - // These semnatic wrappers don't change the constant value. case SemIR::NameRef::Kind: return context.constant_values().Get(inst.As().value_id); @@ -426,6 +420,7 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst) // These cases are either not expressions or not constant. case SemIR::AddrPattern::Kind: case SemIR::Assign::Kind: + case SemIR::BindName::Kind: case SemIR::BlockArg::Kind: case SemIR::Branch::Kind: case SemIR::BranchIf::Kind: diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index 15332be7bc64..bae1802d8a53 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -78,23 +78,17 @@ auto HandleAnyBindingPattern(Context& context, Parse::NodeId parse_node, : llvm::StringLiteral("Variable"), context.sem_ir().StringifyType(cast_type_id)); }); - SemIR::InstId value_id = SemIR::InstId::Invalid; - SemIR::TypeId value_type_id = cast_type_id; - if (context_parse_node_kind == Parse::NodeKind::ReturnedModifier) { - // TODO: Should we check this for the `var` as a whole, rather than for - // the name binding? - CARBON_CHECK(!enclosing_class_decl) << "`returned var` at class scope"; - value_id = - CheckReturnedVar(context, context.node_stack().PeekParseNode(), - name_node, name_id, type_node, cast_type_id); - } else if (enclosing_class_decl) { + if (enclosing_class_decl) { + CARBON_CHECK(context_parse_node_kind == + Parse::NodeKind::VariableIntroducer) + << "`returned var` at class scope"; auto& class_info = context.classes().Get(enclosing_class_decl->class_id); - value_type_id = context.GetUnboundElementType(class_info.self_type_id, - cast_type_id); - value_id = context.AddInst( + auto field_type_id = context.GetUnboundElementType( + class_info.self_type_id, cast_type_id); + auto field_id = context.AddInst( {binding_id, SemIR::FieldDecl{ - value_type_id, name_id, + field_type_id, name_id, SemIR::ElementIndex(context.args_type_info_stack() .PeekCurrentBlockContents() .size())}}); @@ -102,11 +96,22 @@ auto HandleAnyBindingPattern(Context& context, Parse::NodeId parse_node, // Add a corresponding field to the object representation of the class. context.args_type_info_stack().AddInstId(context.AddInstInNoBlock( {binding_id, SemIR::StructTypeField{name_id, cast_type_id}})); + context.node_stack().Push(parse_node, field_id); + break; + } + + SemIR::InstId value_id = SemIR::InstId::Invalid; + if (context_parse_node_kind == Parse::NodeKind::ReturnedModifier) { + // TODO: Should we check this for the `var` as a whole, rather than for + // the name binding? + value_id = + CheckReturnedVar(context, context.node_stack().PeekParseNode(), + name_node, name_id, type_node, cast_type_id); } else { value_id = context.AddInst( - {name_node, SemIR::VarStorage{value_type_id, name_id}}); + {name_node, SemIR::VarStorage{cast_type_id, name_id}}); } - auto bind_id = context.AddInst(make_bind_name(value_type_id, value_id)); + auto bind_id = context.AddInst(make_bind_name(cast_type_id, value_id)); context.node_stack().Push(parse_node, bind_id); if (context_parse_node_kind == Parse::NodeKind::ReturnedModifier) { diff --git a/toolchain/check/handle_variable.cpp b/toolchain/check/handle_variable.cpp index 844960c1417e..d03d356e4b34 100644 --- a/toolchain/check/handle_variable.cpp +++ b/toolchain/check/handle_variable.cpp @@ -52,6 +52,12 @@ auto HandleVariableDecl(Context& context, Parse::VariableDeclId parse_node) context.bind_names().Get(bind_name->bind_name_id).name_id); context.decl_name_stack().AddNameToLookup(name_context, value_id); value_id = bind_name->value_id; + } else if (auto field_decl = + context.insts().TryGetAs(value_id)) { + // Introduce the field name into the class. + auto name_context = context.decl_name_stack().MakeUnqualifiedName( + context.insts().GetParseNode(value_id), field_decl->name_id); + context.decl_name_stack().AddNameToLookup(name_context, value_id); } // TODO: Handle other kinds of pattern. diff --git a/toolchain/check/testdata/as/as_type.carbon b/toolchain/check/testdata/as/as_type.carbon index 92f267bb9747..6f04da09a88c 100644 --- a/toolchain/check/testdata/as/as_type.carbon +++ b/toolchain/check/testdata/as/as_type.carbon @@ -17,6 +17,6 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: package: = namespace package, {} [template] // CHECK:STDOUT: %.loc7_24.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_24.2: type = converted %.loc7_24.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %t: type = bind_name t, %.loc7_24.2 [template = constants.%.2] +// CHECK:STDOUT: %t: type = bind_name t, %.loc7_24.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 03518ed9af57..f9d601eeaf93 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -25,6 +25,6 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %.loc10_21: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc10_35.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_35.2: type = converted %.loc10_35.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %n: (i32, i32) = bind_name n, [template = ] +// CHECK:STDOUT: %n: (i32, i32) = bind_name n, // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index fcb0e774476a..6288ae5ce32a 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -20,6 +20,6 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: package: = namespace package, {} [template] // CHECK:STDOUT: %.loc10_14: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc10_19: i32 = int_literal 2 [template = constants.%.2] -// CHECK:STDOUT: %n: i32 = bind_name n, [template = ] +// CHECK:STDOUT: %n: i32 = bind_name n, // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index 346ec50242c2..79a92177aadc 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -29,7 +29,7 @@ var test_type: type = i32; // CHECK:STDOUT: %.loc8: f64 = real_literal 1e-1 [template = constants.%.2] // CHECK:STDOUT: assign %test_f64.var, %.loc8 // CHECK:STDOUT: %.loc9: String = string_literal "Test" [template = constants.%.4] -// CHECK:STDOUT: %test_str: String = bind_name test_str, %.loc9 [template = constants.%.4] +// CHECK:STDOUT: %test_str: String = bind_name test_str, %.loc9 // CHECK:STDOUT: %test_type.var: ref type = var test_type // CHECK:STDOUT: %test_type: ref type = bind_name test_type, %test_type.var // CHECK:STDOUT: assign %test_type.var, i32 diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index c8833dd6d2ab..367c70a8ca45 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -56,21 +56,19 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %.loc8: = field_decl b, element0 [template] -// CHECK:STDOUT: %b: = bind_name b, %.loc8 [template = %.loc8] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .b = %.loc8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %.loc12: = base_decl Base, element0 [template] // CHECK:STDOUT: %.loc14: = field_decl d, element1 [template] -// CHECK:STDOUT: %d: = bind_name d, %.loc14 [template = %.loc14] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .base = %.loc12 -// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: .d = %.loc14 // CHECK:STDOUT: extend name_scope1 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base_field.carbon b/toolchain/check/testdata/class/base_field.carbon index 3bb20560017e..98bc00e3e533 100644 --- a/toolchain/check/testdata/class/base_field.carbon +++ b/toolchain/check/testdata/class/base_field.carbon @@ -48,30 +48,25 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: %.loc9: = field_decl b, element1 [template] -// CHECK:STDOUT: %b: = bind_name b, %.loc9 [template = %.loc9] // CHECK:STDOUT: %.loc10: = field_decl c, element2 [template] -// CHECK:STDOUT: %c: = bind_name c, %.loc10 [template = %.loc10] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .a = %.loc8 +// CHECK:STDOUT: .b = %.loc9 +// CHECK:STDOUT: .c = %.loc10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %.loc14: = base_decl Base, element0 [template] // CHECK:STDOUT: %.loc16: = field_decl d, element1 [template] -// CHECK:STDOUT: %d: = bind_name d, %.loc16 [template = %.loc16] // CHECK:STDOUT: %.loc17: = field_decl e, element2 [template] -// CHECK:STDOUT: %e: = bind_name e, %.loc17 [template = %.loc17] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .base = %.loc14 -// CHECK:STDOUT: .d = %d -// CHECK:STDOUT: .e = %e +// CHECK:STDOUT: .d = %.loc16 +// CHECK:STDOUT: .e = %.loc17 // CHECK:STDOUT: extend name_scope1 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index a5438279360a..c64b540b1cb8 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -50,11 +50,10 @@ fn Call(p: Derived*) { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: %F: = fn_decl @F [template] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .a = %.loc8 // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index c3f4f45b7274..ea4a31cc46ed 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -42,12 +42,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %F: = fn_decl @F [template] // CHECK:STDOUT: %G: = fn_decl @G [template] // CHECK:STDOUT: %.loc14: = field_decl k, element0 [template] -// CHECK:STDOUT: %k: = bind_name k, %.loc14 [template = %.loc14] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G -// CHECK:STDOUT: .k = %k +// CHECK:STDOUT: .k = %.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%n: i32) -> i32 { diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index 3f97c3a2d506..2500bbfa3592 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -83,21 +83,19 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .a = %.loc8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, constants.%A [template = constants.%A] // CHECK:STDOUT: %.loc12: = base_decl A, element0 [template] // CHECK:STDOUT: %.loc13: = field_decl b, element1 [template] -// CHECK:STDOUT: %b: = bind_name b, %.loc13 [template = %.loc13] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .base = %.loc12 -// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .b = %.loc13 // CHECK:STDOUT: extend name_scope1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -105,11 +103,10 @@ fn ConvertInit() { // CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B] // CHECK:STDOUT: %.loc17: = base_decl B, element0 [template] // CHECK:STDOUT: %.loc18: = field_decl c, element1 [template] -// CHECK:STDOUT: %c: = bind_name c, %.loc18 [template = %.loc18] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .base = %.loc17 -// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .c = %.loc18 // CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index 97e43478dbaf..7c5c5fb8e8d8 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -58,21 +58,19 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: class @Abstract { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .a = %.loc8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, constants.%Abstract [template = constants.%Abstract] // CHECK:STDOUT: %.loc12: = base_decl Abstract, element0 [template] // CHECK:STDOUT: %.loc14: = field_decl d, element1 [template] -// CHECK:STDOUT: %d: = bind_name d, %.loc14 [template = %.loc14] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .base = %.loc12 -// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: .d = %.loc14 // CHECK:STDOUT: extend name_scope1 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index f6d44525378b..c0339e13c9ed 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -201,10 +201,9 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Final { // CHECK:STDOUT: %.loc9: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc9 [template = %.loc9] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .a = %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @DeriveFromError { diff --git a/toolchain/check/testdata/class/fail_base_unbound.carbon b/toolchain/check/testdata/class/fail_base_unbound.carbon index 70b96cd02e65..18124606e5a4 100644 --- a/toolchain/check/testdata/class/fail_base_unbound.carbon +++ b/toolchain/check/testdata/class/fail_base_unbound.carbon @@ -34,7 +34,7 @@ let b: B = C.base; // CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B] // CHECK:STDOUT: %C.ref: type = name_ref C, constants.%C [template = constants.%C] // CHECK:STDOUT: %base.ref: = name_ref base, @C.%.loc10 [template = @C.%.loc10] -// CHECK:STDOUT: %b: B = bind_name b, [template = ] +// CHECK:STDOUT: %b: B = bind_name b, // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index f90dc5194b14..693cfd240dbc 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -64,29 +64,26 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: class @A1 { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .a = %.loc8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A2 { // CHECK:STDOUT: %.loc12: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc12 [template = %.loc12] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .a = %.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B2 { // CHECK:STDOUT: %A2.ref: type = name_ref A2, constants.%A2 [template = constants.%A2] // CHECK:STDOUT: %.loc16: = base_decl A2, element0 [template] // CHECK:STDOUT: %.loc17: = field_decl b, element1 [template] -// CHECK:STDOUT: %b: = bind_name b, %.loc17 [template = %.loc17] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .base = %.loc16 -// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .b = %.loc17 // CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 6b2b094aa9d9..1cecf949e86f 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -44,16 +44,14 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc12: = field_decl j, element0 [template] -// CHECK:STDOUT: %j: = bind_name j, %.loc12 [template = %.loc12] // CHECK:STDOUT: %.loc17: = field_decl k, element1 [template] -// CHECK:STDOUT: %k: = bind_name k, %.loc17 [template = %.loc17] // CHECK:STDOUT: %.loc22: i32 = int_literal 0 [template = constants.%.2] -// CHECK:STDOUT: %l: i32 = bind_name l, %.loc22 [template = constants.%.2] +// CHECK:STDOUT: %l: i32 = bind_name l, %.loc22 // CHECK:STDOUT: %.loc27: i32 = int_literal 1 [template = constants.%.3] -// CHECK:STDOUT: %m: i32 = bind_name m, %.loc27 [template = constants.%.3] +// CHECK:STDOUT: %m: i32 = bind_name m, %.loc27 // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .j = %j -// CHECK:STDOUT: .k = %k +// CHECK:STDOUT: .j = %.loc12 +// CHECK:STDOUT: .k = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index a9ce0fe81142..918231a26bb0 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -181,7 +181,7 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %p.ref: Class* = name_ref p, %p // CHECK:STDOUT: %.loc75: ref Class = deref %p.ref -// CHECK:STDOUT: %c: = bind_name c, [template = ] +// CHECK:STDOUT: %c: = bind_name c, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index 447a8f654c6c..44da2521bfa2 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -47,13 +47,11 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: %.loc9: = field_decl b, element1 [template] -// CHECK:STDOUT: %b: = bind_name b, %.loc9 [template = %.loc9] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .a = %.loc8 +// CHECK:STDOUT: .b = %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index ede941f91dac..09c2430d6ba0 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -45,13 +45,11 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: %.loc9: = field_decl b, element1 [template] -// CHECK:STDOUT: %b: = bind_name b, %.loc9 [template = %.loc9] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .a = %.loc8 +// CHECK:STDOUT: .b = %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%p: Class*); diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 163574a6f02d..8093897715a9 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -65,10 +65,9 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, constants.%A [template = constants.%A] // CHECK:STDOUT: %.loc12: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc12 [template = %.loc12] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .a = %.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1[addr %self: A*](); diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index a920d6618196..a43ad84f5ec5 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -29,7 +29,7 @@ fn T.F() {} // CHECK:STDOUT: package: = namespace package, {.Class = %Class.decl} [template] // CHECK:STDOUT: %Class.decl = class_decl @Class, () // CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %T: type = bind_name T, %Class.ref [template = constants.%Class] +// CHECK:STDOUT: %T: type = bind_name T, %Class.ref // CHECK:STDOUT: %.loc19: = fn_decl @.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_todo_modifiers.carbon b/toolchain/check/testdata/class/fail_todo_modifiers.carbon index ada889dd1947..d5b6180c993a 100644 --- a/toolchain/check/testdata/class/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_todo_modifiers.carbon @@ -80,15 +80,13 @@ abstract class Abstract { // CHECK:STDOUT: %F: = fn_decl @F [template] // CHECK:STDOUT: %G: = fn_decl @G [template] // CHECK:STDOUT: %.loc22: = field_decl k, element0 [template] -// CHECK:STDOUT: %k: = bind_name k, %.loc22 [template = %.loc22] // CHECK:STDOUT: %.loc27: = field_decl l, element1 [template] -// CHECK:STDOUT: %l: = bind_name l, %.loc27 [template = %.loc27] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G -// CHECK:STDOUT: .k = %k -// CHECK:STDOUT: .l = %l +// CHECK:STDOUT: .k = %.loc22 +// CHECK:STDOUT: .l = %.loc27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 1d1c0b9a5b4e..23a5638518cf 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -37,24 +37,23 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8: = field_decl field, element0 [template] -// CHECK:STDOUT: %field: = bind_name field, %.loc8 [template = %.loc8] // CHECK:STDOUT: %F: = fn_decl @F [template] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .field = %field +// CHECK:STDOUT: .field = %.loc8 // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %field.ref: = name_ref field, @Class.%field [template = @Class.%.loc8] +// CHECK:STDOUT: %field.ref: = name_ref field, @Class.%.loc8 [template = @Class.%.loc8] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %field.ref: = name_ref field, @Class.%field [template = @Class.%.loc8] +// CHECK:STDOUT: %field.ref: = name_ref field, @Class.%.loc8 [template = @Class.%.loc8] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index e99faac46a40..7399a8d9f808 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -33,10 +33,9 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8: = field_decl n, element0 [template] -// CHECK:STDOUT: %n: = bind_name n, %.loc8 [template = %.loc8] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .n = %n +// CHECK:STDOUT: .n = %.loc8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%c: Class) -> i32 { diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index af06b9da8b06..b904f82e5439 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -36,13 +36,11 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8: = field_decl j, element0 [template] -// CHECK:STDOUT: %j: = bind_name j, %.loc8 [template = %.loc8] // CHECK:STDOUT: %.loc9: = field_decl k, element1 [template] -// CHECK:STDOUT: %k: = bind_name k, %.loc9 [template = %.loc9] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .j = %j -// CHECK:STDOUT: .k = %k +// CHECK:STDOUT: .j = %.loc8 +// CHECK:STDOUT: .k = %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 0f13c83e23c3..8051fadb06ca 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -37,13 +37,11 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8: = field_decl j, element0 [template] -// CHECK:STDOUT: %j: = bind_name j, %.loc8 [template = %.loc8] // CHECK:STDOUT: %.loc9: = field_decl k, element1 [template] -// CHECK:STDOUT: %k: = bind_name k, %.loc9 [template = %.loc9] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .j = %j -// CHECK:STDOUT: .k = %k +// CHECK:STDOUT: .j = %.loc8 +// CHECK:STDOUT: .k = %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Test() { diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 929d73facd8a..3b1cb20bf7e1 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -38,15 +38,13 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8: = field_decl n, element0 [template] -// CHECK:STDOUT: %n: = bind_name n, %.loc8 [template = %.loc8] // CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc9_18: type = ptr_type Class [template = constants.%.2] // CHECK:STDOUT: %.loc9_11: = field_decl next, element1 [template] -// CHECK:STDOUT: %next: = bind_name next, %.loc9_11 [template = %.loc9_11] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .n = %n -// CHECK:STDOUT: .next = %next +// CHECK:STDOUT: .n = %.loc8 +// CHECK:STDOUT: .next = %.loc9_11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Make(%n: i32, %next: Class*) -> %return: Class { diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 36e57a536852..42641851c0d0 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -33,13 +33,11 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: %.loc9: = field_decl b, element1 [template] -// CHECK:STDOUT: %b: = bind_name b, %.loc9 [template = %.loc9] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .a = %.loc8 +// CHECK:STDOUT: .b = %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index a5419fa26e03..24ac9a517abd 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -45,26 +45,22 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: %.loc9: = field_decl b, element1 [template] -// CHECK:STDOUT: %b: = bind_name b, %.loc9 [template = %.loc9] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .a = %.loc8 +// CHECK:STDOUT: .b = %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { // CHECK:STDOUT: %Inner.ref.loc15: type = name_ref Inner, constants.%Inner [template = constants.%Inner] // CHECK:STDOUT: %.loc15: = field_decl c, element0 [template] -// CHECK:STDOUT: %c: = bind_name c, %.loc15 [template = %.loc15] // CHECK:STDOUT: %Inner.ref.loc16: type = name_ref Inner, constants.%Inner [template = constants.%Inner] // CHECK:STDOUT: %.loc16: = field_decl d, element1 [template] -// CHECK:STDOUT: %d: = bind_name d, %.loc16 [template = %.loc16] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: .c = %.loc15 +// CHECK:STDOUT: .d = %.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @MakeInner() -> %return: Inner; diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 2c37fb0aae81..9bd7a14ba7e2 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -78,12 +78,11 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %F: = fn_decl @F [template] // CHECK:STDOUT: %G: = fn_decl @G [template] // CHECK:STDOUT: %.loc11: = field_decl k, element0 [template] -// CHECK:STDOUT: %k: = bind_name k, %.loc11 [template = %.loc11] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G -// CHECK:STDOUT: .k = %k +// CHECK:STDOUT: .k = %.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self: Class]() -> i32 { diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index 8ef6121fe97b..f2fde56bbbd9 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -56,41 +56,35 @@ fn F(a: Outer*) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Outer [template = constants.%Outer] // CHECK:STDOUT: %.loc14_15: type = ptr_type Outer [template = constants.%.3] // CHECK:STDOUT: %.loc14_9: = field_decl po, element0 [template] -// CHECK:STDOUT: %po: = bind_name po, %.loc14_9 [template = %.loc14_9] // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, constants.%Outer [template = constants.%Outer] // CHECK:STDOUT: %.loc15_16: type = ptr_type Outer [template = constants.%.3] // CHECK:STDOUT: %.loc15_9: = field_decl qo, element1 [template] -// CHECK:STDOUT: %qo: = bind_name qo, %.loc15_9 [template = %.loc15_9] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, constants.%Inner [template = constants.%Inner] // CHECK:STDOUT: %.loc16_16: type = ptr_type Inner [template = constants.%.1] // CHECK:STDOUT: %.loc16_9: = field_decl pi, element2 [template] -// CHECK:STDOUT: %pi: = bind_name pi, %.loc16_9 [template = %.loc16_9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Inner = %Inner.decl -// CHECK:STDOUT: .po = %po -// CHECK:STDOUT: .qo = %qo -// CHECK:STDOUT: .pi = %pi +// CHECK:STDOUT: .po = %.loc14_9 +// CHECK:STDOUT: .qo = %.loc15_9 +// CHECK:STDOUT: .pi = %.loc16_9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Inner [template = constants.%Inner] // CHECK:STDOUT: %.loc9_17: type = ptr_type Inner [template = constants.%.1] // CHECK:STDOUT: %.loc9_11: = field_decl pi, element0 [template] -// CHECK:STDOUT: %pi: = bind_name pi, %.loc9_11 [template = %.loc9_11] // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, constants.%Outer [template = constants.%Outer] // CHECK:STDOUT: %.loc10_18: type = ptr_type Outer [template = constants.%.3] // CHECK:STDOUT: %.loc10_11: = field_decl po, element1 [template] -// CHECK:STDOUT: %po: = bind_name po, %.loc10_11 [template = %.loc10_11] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, constants.%Inner [template = constants.%Inner] // CHECK:STDOUT: %.loc11_18: type = ptr_type Inner [template = constants.%.1] // CHECK:STDOUT: %.loc11_11: = field_decl qi, element2 [template] -// CHECK:STDOUT: %qi: = bind_name qi, %.loc11_11 [template = %.loc11_11] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .pi = %pi -// CHECK:STDOUT: .po = %po -// CHECK:STDOUT: .qi = %qi +// CHECK:STDOUT: .pi = %.loc9_11 +// CHECK:STDOUT: .po = %.loc10_11 +// CHECK:STDOUT: .qi = %.loc11_11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a: Outer*) { diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 8cc0e0bb27cd..24d93ed11e5d 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -47,10 +47,9 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { // CHECK:STDOUT: %.loc9: = field_decl n, element0 [template] -// CHECK:STDOUT: %n: = bind_name n, %.loc9 [template = %.loc9] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .n = %n +// CHECK:STDOUT: .n = %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%oi: Inner) -> i32 { diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index 0b17468cd175..d706c8e2e655 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -42,12 +42,11 @@ fn Class.G[self: Class](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %F: = fn_decl @F [template] // CHECK:STDOUT: %G: = fn_decl @G [template] // CHECK:STDOUT: %.loc10: = field_decl n, element0 [template] -// CHECK:STDOUT: %n: = bind_name n, %.loc10 [template = %.loc10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G -// CHECK:STDOUT: .n = %n +// CHECK:STDOUT: .n = %.loc10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F[addr %self.loc13_17: Class*](%self.loc13_31: i32) { diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 883bac027742..0936d8d11fe3 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -40,12 +40,11 @@ fn Class.G[addr self: Class*]() -> i32 { // CHECK:STDOUT: %F: = fn_decl @F [template] // CHECK:STDOUT: %G: = fn_decl @G [template] // CHECK:STDOUT: %.loc11: = field_decl n, element0 [template] -// CHECK:STDOUT: %n: = bind_name n, %.loc11 [template = %.loc11] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G -// CHECK:STDOUT: .n = %n +// CHECK:STDOUT: .n = %.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self: Class]() -> i32 { diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index 4d72aff71db1..0ba43d9f2c9f 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -57,10 +57,9 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .a = %.loc8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index da5abebff295..2453c53e670f 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -37,11 +37,10 @@ fn Class.F[self: Class]() -> i32 { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc9_14: type = ptr_type Class [template = constants.%.1] // CHECK:STDOUT: %.loc9_8: = field_decl p, element0 [template] -// CHECK:STDOUT: %p: = bind_name p, %.loc9_8 [template = %.loc9_8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F -// CHECK:STDOUT: .p = %p +// CHECK:STDOUT: .p = %.loc9_8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self: Class]() -> i32 { diff --git a/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon b/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon index 9fc094b389a0..71301ec3590a 100644 --- a/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon +++ b/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon @@ -33,7 +33,7 @@ fn F(T:! type, U:! type) { // CHECK:STDOUT: %p.ref: ref T* = name_ref p, %p // CHECK:STDOUT: %.loc12_15: T* = bind_value %p.ref // CHECK:STDOUT: %.loc12_14: ref T = deref %.loc12_15 -// CHECK:STDOUT: %n: U = bind_name n, [template = ] +// CHECK:STDOUT: %n: U = bind_name n, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index 8ca94d17c8e1..ab86b10e181a 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -55,6 +55,6 @@ class C { // CHECK:STDOUT: if %.loc33 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .n = +// CHECK:STDOUT: .n = // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 8f434cc55c9b..36e58ad69cb8 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -28,7 +28,7 @@ fn F(a: i32) { // CHECK:STDOUT: fn @F(%a.loc7: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc14: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %a.loc14: i32 = bind_name a, %.loc14 [template = constants.%.1] +// CHECK:STDOUT: %a.loc14: i32 = bind_name a, %.loc14 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 3f7eaec4f099..03b67a545d5d 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -33,8 +33,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %T: type = bind_symbolic_name T, i32 [symbolic] // CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = %T] // CHECK:STDOUT: %.loc13: i32 = int_literal 5 [template = constants.%.1] -// CHECK:STDOUT: %x: T = bind_name x, [template = ] -// CHECK:STDOUT: %x.ref: T = name_ref x, %x [template = ] +// CHECK:STDOUT: %x: T = bind_name x, +// CHECK:STDOUT: %x.ref: T = name_ref x, %x // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index e20d6a69fa43..32dcd77ce18c 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -77,20 +77,20 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace package, {} [template] // CHECK:STDOUT: %.loc10: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc10 [template = constants.%.1] +// CHECK:STDOUT: %b: i32 = bind_name b, %.loc10 // CHECK:STDOUT: %.loc15: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %c: i32 = bind_name c, %.loc15 [template = constants.%.1] +// CHECK:STDOUT: %c: i32 = bind_name c, %.loc15 // CHECK:STDOUT: %.loc20: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %d: i32 = bind_name d, %.loc20 [template = constants.%.1] +// CHECK:STDOUT: %d: i32 = bind_name d, %.loc20 // CHECK:STDOUT: %.loc25: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %e: i32 = bind_name e, %.loc25 [template = constants.%.1] +// CHECK:STDOUT: %e: i32 = bind_name e, %.loc25 // CHECK:STDOUT: %.loc36: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %f: i32 = bind_name f, %.loc36 [template = constants.%.1] +// CHECK:STDOUT: %f: i32 = bind_name f, %.loc36 // CHECK:STDOUT: %.loc47: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %g: i32 = bind_name g, %.loc47 [template = constants.%.1] +// CHECK:STDOUT: %g: i32 = bind_name g, %.loc47 // CHECK:STDOUT: %.loc58: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %h: i32 = bind_name h, %.loc58 [template = constants.%.1] +// CHECK:STDOUT: %h: i32 = bind_name h, %.loc58 // CHECK:STDOUT: %.loc69: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %i: i32 = bind_name i, %.loc69 [template = constants.%.1] +// CHECK:STDOUT: %i: i32 = bind_name i, %.loc69 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_todo_modifiers.carbon b/toolchain/check/testdata/let/fail_todo_modifiers.carbon index d4095b1cb711..64c7310bbfc8 100644 --- a/toolchain/check/testdata/let/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_todo_modifiers.carbon @@ -18,6 +18,6 @@ private let a: i32 = 1; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace package, {} [template] // CHECK:STDOUT: %.loc10: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc10 [template = constants.%.1] +// CHECK:STDOUT: %a: i32 = bind_name a, %.loc10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index 8f9b0232d25f..64a7bc0f0fea 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -21,7 +21,7 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] -// CHECK:STDOUT: %a: i32 = bind_name a, [template = ] +// CHECK:STDOUT: %a: i32 = bind_name a, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 9ffb4b4c98db..2b7bba2b776b 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -17,13 +17,13 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace package, {.F = %F} [template] // CHECK:STDOUT: %.loc7: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %n: i32 = bind_name n, %.loc7 [template = constants.%.1] +// CHECK:STDOUT: %n: i32 = bind_name n, %.loc7 // CHECK:STDOUT: %F: = fn_decl @F [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, file.%n [template = constants.%.1] +// CHECK:STDOUT: %n.ref: i32 = name_ref n, file.%n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/unary_op.carbon b/toolchain/check/testdata/operators/unary_op.carbon index 79f9774ae302..713d7f3446d9 100644 --- a/toolchain/check/testdata/operators/unary_op.carbon +++ b/toolchain/check/testdata/operators/unary_op.carbon @@ -23,10 +23,10 @@ let not_false: bool = not false; // CHECK:STDOUT: %Not: = fn_decl @Not [template] // CHECK:STDOUT: %.loc11_26: bool = bool_literal true [template = constants.%.1] // CHECK:STDOUT: %.loc11_22: bool = not %.loc11_26 [template = constants.%.2] -// CHECK:STDOUT: %not_true: bool = bind_name not_true, %.loc11_22 [template = constants.%.2] +// CHECK:STDOUT: %not_true: bool = bind_name not_true, %.loc11_22 // CHECK:STDOUT: %.loc12_27: bool = bool_literal false [template = constants.%.2] // CHECK:STDOUT: %.loc12_23: bool = not %.loc12_27 [template = constants.%.1] -// CHECK:STDOUT: %not_false: bool = bind_name not_false, %.loc12_23 [template = constants.%.1] +// CHECK:STDOUT: %not_false: bool = bind_name not_false, %.loc12_23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Not(%b: bool) -> bool { diff --git a/toolchain/check/testdata/pointer/fail_deref_error.carbon b/toolchain/check/testdata/pointer/fail_deref_error.carbon index 7dad391c872c..135740ed4665 100644 --- a/toolchain/check/testdata/pointer/fail_deref_error.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_error.carbon @@ -15,6 +15,6 @@ let n: i32 = *undeclared; // CHECK:STDOUT: package: = namespace package, {} [template] // CHECK:STDOUT: %undeclared.ref: = name_ref undeclared, [template = ] // CHECK:STDOUT: %.loc10: ref = deref -// CHECK:STDOUT: %n: i32 = bind_name n, [template = ] +// CHECK:STDOUT: %n: i32 = bind_name n, // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_let_in_type.carbon b/toolchain/check/testdata/return/fail_let_in_type.carbon index f52eb468de25..a6decbf2b879 100644 --- a/toolchain/check/testdata/return/fail_let_in_type.carbon +++ b/toolchain/check/testdata/return/fail_let_in_type.carbon @@ -4,8 +4,10 @@ // // AUTOUPDATE -// TODO: This should require `:!` rather than just `:`. let x: type = i32; +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+3]]:13: ERROR: Cannot evaluate type expression. +// CHECK:STDERR: fn Six() -> x { return 6; } +// CHECK:STDERR: ^ fn Six() -> x { return 6; } // TODO: This should probably work. @@ -31,15 +33,15 @@ fn FirstPerfectNumber() -> z { return 6; } // CHECK:STDOUT: file { // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Six() -> i32 { +// CHECK:STDOUT: fn @Six() -> { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9: i32 = int_literal 6 [template = constants.%.1] -// CHECK:STDOUT: return %.loc9 +// CHECK:STDOUT: %.loc11: i32 = int_literal 6 [template = constants.%.1] +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @HalfDozen() -> y { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc16: i32 = int_literal 6 [template = constants.%.1] +// CHECK:STDOUT: %.loc18: i32 = int_literal 6 [template = constants.%.1] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index 4308d36d9764..d7950272c601 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -49,13 +49,11 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %.loc18_16: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc18_16 [template = %.loc18_16] // CHECK:STDOUT: %.loc18_28: = field_decl b, element1 [template] -// CHECK:STDOUT: %b: = bind_name b, %.loc18_28 [template = %.loc18_28] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .a = %.loc18_16 +// CHECK:STDOUT: .b = %.loc18_28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index db812e08432f..6e24d83129d5 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -30,7 +30,7 @@ fn Procedure() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc14_20.1: () = tuple_literal () // CHECK:STDOUT: %.loc14_20.2: type = converted %.loc14_20.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %v: () = bind_name v, [template = ] +// CHECK:STDOUT: %v: () = bind_name v, // CHECK:STDOUT: %.loc14_25: () = tuple_literal () // CHECK:STDOUT: assign , // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index ddad6db72e19..0a43a826b5b1 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -28,7 +28,7 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Mismatch() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %v: f64 = bind_name v, [template = ] +// CHECK:STDOUT: %v: f64 = bind_name v, // CHECK:STDOUT: %.loc14: f64 = real_literal 0e-1 [template = constants.%.1] // CHECK:STDOUT: assign , // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index fa774308735c..b4b1814f01ed 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -41,13 +41,11 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %.loc8: = field_decl a, element0 [template] -// CHECK:STDOUT: %a: = bind_name a, %.loc8 [template = %.loc8] // CHECK:STDOUT: %.loc9: = field_decl b, element1 [template] -// CHECK:STDOUT: %b: = bind_name b, %.loc9 [template = %.loc9] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .a = %.loc8 +// CHECK:STDOUT: .b = %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %return: C { diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index 848d9f34f74d..d5bb5c6f0e33 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -61,10 +61,10 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: %F: = fn_decl @F [template] // CHECK:STDOUT: %.loc21_35: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc21_36: {.a: i32} = struct_literal (%.loc21_35) -// CHECK:STDOUT: %v: = bind_name v, [template = ] +// CHECK:STDOUT: %v: = bind_name v, // CHECK:STDOUT: %.loc29_22: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc29_32: i32 = int_literal 2 [template = constants.%.3] -// CHECK:STDOUT: %w: i32 = bind_name w, [template = ] +// CHECK:STDOUT: %w: i32 = bind_name w, // CHECK:STDOUT: %.loc37_16: type = struct_type {.a: i32} [template = constants.%.2] // CHECK:STDOUT: %x.var: ref {.a: i32} = var x // CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index 5cb0bf6158d3..706c0fb64fc9 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -28,10 +28,10 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %.loc7_44.1: {.a: i32, .b: i32} = struct_literal (%.loc7_35, %.loc7_43) // CHECK:STDOUT: %.loc7_44.2: {.a: i32, .b: i32} = struct_value (%.loc7_35, %.loc7_43) [template = constants.%.5] // CHECK:STDOUT: %.loc7_44.3: {.a: i32, .b: i32} = converted %.loc7_44.1, %.loc7_44.2 [template = constants.%.5] -// CHECK:STDOUT: %v: {.a: i32, .b: i32} = bind_name v, %.loc7_44.3 [template = constants.%.5] +// CHECK:STDOUT: %v: {.a: i32, .b: i32} = bind_name v, %.loc7_44.3 // CHECK:STDOUT: %.loc8: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %v.ref: {.a: i32, .b: i32} = name_ref v, %v [template = constants.%.5] -// CHECK:STDOUT: %w: {.a: i32, .b: i32} = bind_name w, %v.ref [template = constants.%.5] +// CHECK:STDOUT: %v.ref: {.a: i32, .b: i32} = name_ref v, %v +// CHECK:STDOUT: %w: {.a: i32, .b: i32} = bind_name w, %v.ref // CHECK:STDOUT: %.loc10_25: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {.a: i32, .b: i32} = var x // CHECK:STDOUT: %x: ref {.a: i32, .b: i32} = bind_name x, %x.var diff --git a/toolchain/check/testdata/tuples/two_elements.carbon b/toolchain/check/testdata/tuples/two_elements.carbon index cf9147925f47..e9306ba8b566 100644 --- a/toolchain/check/testdata/tuples/two_elements.carbon +++ b/toolchain/check/testdata/tuples/two_elements.carbon @@ -30,11 +30,11 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %.loc7_28.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_25) // CHECK:STDOUT: %.loc7_28.2: (i32, i32) = tuple_value (%.loc7_22, %.loc7_25) [template = constants.%.6] // CHECK:STDOUT: %.loc7_28.3: (i32, i32) = converted %.loc7_28.1, %.loc7_28.2 [template = constants.%.6] -// CHECK:STDOUT: %v: (i32, i32) = bind_name v, %.loc7_28.3 [template = constants.%.6] +// CHECK:STDOUT: %v: (i32, i32) = bind_name v, %.loc7_28.3 // CHECK:STDOUT: %.loc8_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc8_17.2: type = converted %.loc8_17.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %v.ref: (i32, i32) = name_ref v, %v [template = constants.%.6] -// CHECK:STDOUT: %w: (i32, i32) = bind_name w, %v.ref [template = constants.%.6] +// CHECK:STDOUT: %v.ref: (i32, i32) = name_ref v, %v +// CHECK:STDOUT: %w: (i32, i32) = bind_name w, %v.ref // CHECK:STDOUT: %.loc10_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %x.var: ref (i32, i32) = var x