diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 7f647881d314..bb70a62b84c6 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -847,7 +847,7 @@ class TypeCompleter { case SemIR::BranchWithArg::Kind: case SemIR::Call::Kind: case SemIR::ClassDecl::Kind: - case SemIR::ClassFieldAccess::Kind: + case SemIR::ClassElementAccess::Kind: case SemIR::ClassInit::Kind: case SemIR::Converted::Kind: case SemIR::Deref::Kind: @@ -921,7 +921,7 @@ class TypeCompleter { CARBON_FATAL() << "Builtins should be named as cross-references"; case SemIR::PointerType::Kind: - case SemIR::UnboundFieldType::Kind: + case SemIR::UnboundElementType::Kind: return MakeCopyRepresentation(type_id); case SemIR::ConstType::Kind: @@ -1057,10 +1057,10 @@ static auto ProfileType(Context& semantics_context, SemIR::Inst inst, inst.As().elements_id), canonical_id); break; - case SemIR::UnboundFieldType::Kind: { - auto unbound_field_type = inst.As(); + case SemIR::UnboundElementType::Kind: { + auto unbound_field_type = inst.As(); canonical_id.AddInteger(unbound_field_type.class_type_id.index); - canonical_id.AddInteger(unbound_field_type.field_type_id.index); + canonical_id.AddInteger(unbound_field_type.element_type_id.index); break; } default: { diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index e9ab726a566d..43988e894101 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -140,7 +140,7 @@ static auto MakeElementAccessInst(Context& context, Parse::NodeId parse_node, AccessInstT{parse_node, elem_type_id, aggregate_id, index_id}); } else { return block.AddInst(AccessInstT{parse_node, elem_type_id, aggregate_id, - SemIR::MemberIndex(i)}); + SemIR::ElementIndex(i)}); } } @@ -561,7 +561,7 @@ static auto ConvertStructToClass(Context& context, SemIR::StructType src_type, context.insts().Get(value_id).parse_node(), target.type_id}); } - auto result_id = ConvertStructToStructOrClass( + auto result_id = ConvertStructToStructOrClass( context, src_type, dest_struct_type, value_id, target, /*is_class=*/true); if (need_temporary) { diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index 05cdfa73a883..e2aac1123b36 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -88,15 +88,15 @@ auto HandleBindingPattern(Context& context, Parse::NodeId parse_node) -> bool { } else if (enclosing_class_decl) { auto& class_info = context.classes().Get(enclosing_class_decl->class_id); - auto field_type_inst_id = context.AddInst(SemIR::UnboundFieldType{ + auto field_type_inst_id = context.AddInst(SemIR::UnboundElementType{ parse_node, context.GetBuiltinType(SemIR::BuiltinKind::TypeType), class_info.self_type_id, cast_type_id}); value_type_id = context.CanonicalizeType(field_type_inst_id); value_id = context.AddInst( SemIR::Field{parse_node, value_type_id, name_id, - SemIR::MemberIndex(context.args_type_info_stack() - .PeekCurrentBlockContents() - .size())}); + SemIR::ElementIndex(context.args_type_info_stack() + .PeekCurrentBlockContents() + .size())}); // Add a corresponding field to the object representation of the class. context.args_type_info_stack().AddInst( diff --git a/toolchain/check/handle_name.cpp b/toolchain/check/handle_name.cpp index 9669f9d91d29..6896fd830caf 100644 --- a/toolchain/check/handle_name.cpp +++ b/toolchain/check/handle_name.cpp @@ -112,7 +112,7 @@ auto HandleMemberAccessExpr(Context& context, Parse::NodeId parse_node) auto member_type_inst = context.insts().Get( context.sem_ir().GetTypeAllowBuiltinTypes(member_type_id)); if (auto unbound_field_type = - member_type_inst.TryAs()) { + member_type_inst.TryAs()) { // TODO: Check that the unbound field type describes a member of this // class. Perform a conversion of the base if necessary. @@ -125,8 +125,8 @@ auto HandleMemberAccessExpr(Context& context, Parse::NodeId parse_node) CARBON_CHECK(field) << "Unexpected value " << context.insts().Get(field_id) << " for field name expression"; - auto access_id = context.AddInst(SemIR::ClassFieldAccess{ - parse_node, unbound_field_type->field_type_id, base_id, + auto access_id = context.AddInst(SemIR::ClassElementAccess{ + parse_node, unbound_field_type->element_type_id, base_id, field->index}); if (SemIR::GetExprCategory(context.sem_ir(), base_id) == SemIR::ExprCategory::Value && @@ -185,7 +185,7 @@ auto HandleMemberAccessExpr(Context& context, Parse::NodeId parse_node) if (name_id == field.name_id) { context.AddInstAndPush( parse_node, SemIR::StructAccess{parse_node, field.field_type_id, - base_id, SemIR::MemberIndex(i)}); + base_id, SemIR::ElementIndex(i)}); return true; } } diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index c5d3a931e45e..858b868af4be 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -42,7 +42,7 @@ fn Run() { // CHECK:STDOUT: %.loc10_22.1: init (i32,) = call %F.ref() // CHECK:STDOUT: %.loc10_22.2: ref (i32,) = temporary_storage // CHECK:STDOUT: %.loc10_22.3: ref (i32,) = temporary %.loc10_22.2, %.loc10_22.1 -// CHECK:STDOUT: %.loc10_22.4: ref i32 = tuple_access %.loc10_22.3, member0 +// CHECK:STDOUT: %.loc10_22.4: ref i32 = tuple_access %.loc10_22.3, element0 // CHECK:STDOUT: %.loc10_22.5: i32 = bind_value %.loc10_22.4 // CHECK:STDOUT: %.loc10_22.6: i32 = int_literal 0 // CHECK:STDOUT: %.loc10_22.7: ref i32 = array_index %t.var, %.loc10_22.6 diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index dce0ba0056e7..8f7210c928d8 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -25,11 +25,11 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %.loc7_30: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_33: i32 = int_literal 3 // CHECK:STDOUT: %.loc7_34.1: (i32, i32, i32) = tuple_literal (%.loc7_27, %.loc7_30, %.loc7_33) -// CHECK:STDOUT: %.loc7_34.2: ref i32 = tuple_access %a.var, member0 +// CHECK:STDOUT: %.loc7_34.2: ref i32 = tuple_access %a.var, element0 // CHECK:STDOUT: %.loc7_34.3: init i32 = initialize_from %.loc7_27 to %.loc7_34.2 -// CHECK:STDOUT: %.loc7_34.4: ref i32 = tuple_access %a.var, member1 +// CHECK:STDOUT: %.loc7_34.4: ref i32 = tuple_access %a.var, element1 // CHECK:STDOUT: %.loc7_34.5: init i32 = initialize_from %.loc7_30 to %.loc7_34.4 -// CHECK:STDOUT: %.loc7_34.6: ref i32 = tuple_access %a.var, member2 +// CHECK:STDOUT: %.loc7_34.6: ref i32 = tuple_access %a.var, element2 // CHECK:STDOUT: %.loc7_34.7: init i32 = initialize_from %.loc7_33 to %.loc7_34.6 // CHECK:STDOUT: %.loc7_34.8: init (i32, i32, i32) = tuple_init (%.loc7_34.3, %.loc7_34.5, %.loc7_34.7) to %a.var // CHECK:STDOUT: %.loc7_34.9: init (i32, i32, i32) = converted %.loc7_34.1, %.loc7_34.8 @@ -39,17 +39,17 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %b.var: ref [i32; 3] = var b // CHECK:STDOUT: %b: ref [i32; 3] = bind_name b, %b.var // CHECK:STDOUT: %a.ref: ref (i32, i32, i32) = name_ref a, %a -// CHECK:STDOUT: %.loc8_19.1: ref i32 = tuple_access %a.ref, member0 +// CHECK:STDOUT: %.loc8_19.1: ref i32 = tuple_access %a.ref, element0 // CHECK:STDOUT: %.loc8_19.2: i32 = bind_value %.loc8_19.1 // CHECK:STDOUT: %.loc8_19.3: i32 = int_literal 0 // CHECK:STDOUT: %.loc8_19.4: ref i32 = array_index %b.var, %.loc8_19.3 // CHECK:STDOUT: %.loc8_19.5: init i32 = initialize_from %.loc8_19.2 to %.loc8_19.4 -// CHECK:STDOUT: %.loc8_19.6: ref i32 = tuple_access %a.ref, member1 +// CHECK:STDOUT: %.loc8_19.6: ref i32 = tuple_access %a.ref, element1 // CHECK:STDOUT: %.loc8_19.7: i32 = bind_value %.loc8_19.6 // CHECK:STDOUT: %.loc8_19.8: i32 = int_literal 1 // CHECK:STDOUT: %.loc8_19.9: ref i32 = array_index %b.var, %.loc8_19.8 // CHECK:STDOUT: %.loc8_19.10: init i32 = initialize_from %.loc8_19.7 to %.loc8_19.9 -// CHECK:STDOUT: %.loc8_19.11: ref i32 = tuple_access %a.ref, member2 +// CHECK:STDOUT: %.loc8_19.11: ref i32 = tuple_access %a.ref, element2 // CHECK:STDOUT: %.loc8_19.12: i32 = bind_value %.loc8_19.11 // CHECK:STDOUT: %.loc8_19.13: i32 = int_literal 2 // CHECK:STDOUT: %.loc8_19.14: ref i32 = array_index %b.var, %.loc8_19.13 diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 5e9004d509e0..4fee9b76a289 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -62,12 +62,12 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %b.var: ref [i32; 3] = var b // CHECK:STDOUT: %b: ref [i32; 3] = bind_name b, %b.var // CHECK:STDOUT: %t1.ref: ref (i32, String, String) = name_ref t1, %t1 -// CHECK:STDOUT: %.loc16_19.1: ref i32 = tuple_access %t1.ref, member0 +// CHECK:STDOUT: %.loc16_19.1: ref i32 = tuple_access %t1.ref, element0 // CHECK:STDOUT: %.loc16_19.2: i32 = bind_value %.loc16_19.1 // CHECK:STDOUT: %.loc16_19.3: i32 = int_literal 0 // CHECK:STDOUT: %.loc16_19.4: ref i32 = array_index %b.var, %.loc16_19.3 // CHECK:STDOUT: %.loc16_19.5: init i32 = initialize_from %.loc16_19.2 to %.loc16_19.4 -// CHECK:STDOUT: %.loc16_19.6: ref String = tuple_access %t1.ref, member1 +// CHECK:STDOUT: %.loc16_19.6: ref String = tuple_access %t1.ref, element1 // CHECK:STDOUT: assign %b.var, // CHECK:STDOUT: %.loc21_14: i32 = int_literal 3 // CHECK:STDOUT: %.loc21_15: type = array_type %.loc21_14, i32 diff --git a/toolchain/check/testdata/as/tuple.carbon b/toolchain/check/testdata/as/tuple.carbon index f5edbe8da8ed..aca1a2cf081e 100644 --- a/toolchain/check/testdata/as/tuple.carbon +++ b/toolchain/check/testdata/as/tuple.carbon @@ -83,10 +83,10 @@ fn Var() { // CHECK:STDOUT: %b.var: ref (X, X) = var b // CHECK:STDOUT: %b: ref (X, X) = bind_name b, %b.var // CHECK:STDOUT: %Make.ref.loc20_20: = name_ref Make, file.%Make -// CHECK:STDOUT: %.loc20_34.1: ref X = tuple_access %b.var, member0 +// CHECK:STDOUT: %.loc20_34.1: ref X = tuple_access %b.var, element0 // CHECK:STDOUT: %.loc20_24: init X = call %Make.ref.loc20_20() to %.loc20_34.1 // CHECK:STDOUT: %Make.ref.loc20_28: = name_ref Make, file.%Make -// CHECK:STDOUT: %.loc20_34.2: ref X = tuple_access %b.var, member1 +// CHECK:STDOUT: %.loc20_34.2: ref X = tuple_access %b.var, element1 // CHECK:STDOUT: %.loc20_32: init X = call %Make.ref.loc20_28() to %.loc20_34.2 // CHECK:STDOUT: %.loc20_34.3: (X, X) = tuple_literal (%.loc20_24, %.loc20_32) // CHECK:STDOUT: %X.ref.loc20_40: type = name_ref X, file.%X diff --git a/toolchain/check/testdata/basics/raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/raw_and_textual_ir.carbon index c5eb7d0fce09..df2474f95e40 100644 --- a/toolchain/check/testdata/basics/raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_and_textual_ir.carbon @@ -47,9 +47,9 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: inst+10: {kind: BinaryOperatorAdd, arg0: inst+8, arg1: inst+9, type: type0} // CHECK:STDOUT: inst+11: {kind: RealLiteral, arg0: real0, type: type2} // CHECK:STDOUT: inst+12: {kind: TupleLiteral, arg0: block5, type: type3} -// CHECK:STDOUT: inst+13: {kind: TupleAccess, arg0: inst+5, arg1: member0, type: type0} +// CHECK:STDOUT: inst+13: {kind: TupleAccess, arg0: inst+5, arg1: element0, type: type0} // CHECK:STDOUT: inst+14: {kind: InitializeFrom, arg0: inst+10, arg1: inst+13, type: type0} -// CHECK:STDOUT: inst+15: {kind: TupleAccess, arg0: inst+5, arg1: member1, type: type2} +// CHECK:STDOUT: inst+15: {kind: TupleAccess, arg0: inst+5, arg1: element1, type: type2} // CHECK:STDOUT: inst+16: {kind: InitializeFrom, arg0: inst+11, arg1: inst+15, type: type2} // CHECK:STDOUT: inst+17: {kind: TupleInit, arg0: block6, arg1: inst+5, type: type3} // CHECK:STDOUT: inst+18: {kind: Converted, arg0: inst+12, arg1: inst+17, type: type3} @@ -108,9 +108,9 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: %.loc12_13: i32 = add %n.ref, %.loc12_15 // CHECK:STDOUT: %.loc12_18: f64 = real_literal 34e-1 // CHECK:STDOUT: %.loc12_21.1: (i32, f64) = tuple_literal (%.loc12_13, %.loc12_18) -// CHECK:STDOUT: %.loc12_21.2: ref i32 = tuple_access %return, member0 +// CHECK:STDOUT: %.loc12_21.2: ref i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc12_21.3: init i32 = initialize_from %.loc12_13 to %.loc12_21.2 -// CHECK:STDOUT: %.loc12_21.4: ref f64 = tuple_access %return, member1 +// CHECK:STDOUT: %.loc12_21.4: ref f64 = tuple_access %return, element1 // CHECK:STDOUT: %.loc12_21.5: init f64 = initialize_from %.loc12_18 to %.loc12_21.4 // CHECK:STDOUT: %.loc12_21.6: init (i32, f64) = tuple_init (%.loc12_21.3, %.loc12_21.5) to %return // CHECK:STDOUT: %.loc12_21.7: init (i32, f64) = converted %.loc12_21.1, %.loc12_21.6 diff --git a/toolchain/check/testdata/basics/raw_ir.carbon b/toolchain/check/testdata/basics/raw_ir.carbon index 99c0c237dc97..a37e0fe22ef9 100644 --- a/toolchain/check/testdata/basics/raw_ir.carbon +++ b/toolchain/check/testdata/basics/raw_ir.carbon @@ -47,9 +47,9 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: inst+10: {kind: BinaryOperatorAdd, arg0: inst+8, arg1: inst+9, type: type0} // CHECK:STDOUT: inst+11: {kind: RealLiteral, arg0: real0, type: type2} // CHECK:STDOUT: inst+12: {kind: TupleLiteral, arg0: block5, type: type3} -// CHECK:STDOUT: inst+13: {kind: TupleAccess, arg0: inst+5, arg1: member0, type: type0} +// CHECK:STDOUT: inst+13: {kind: TupleAccess, arg0: inst+5, arg1: element0, type: type0} // CHECK:STDOUT: inst+14: {kind: InitializeFrom, arg0: inst+10, arg1: inst+13, type: type0} -// CHECK:STDOUT: inst+15: {kind: TupleAccess, arg0: inst+5, arg1: member1, type: type2} +// CHECK:STDOUT: inst+15: {kind: TupleAccess, arg0: inst+5, arg1: element1, type: type2} // CHECK:STDOUT: inst+16: {kind: InitializeFrom, arg0: inst+11, arg1: inst+15, type: type2} // CHECK:STDOUT: inst+17: {kind: TupleInit, arg0: block6, arg1: inst+5, type: type3} // CHECK:STDOUT: inst+18: {kind: Converted, arg0: inst+12, arg1: inst+17, type: type3} diff --git a/toolchain/check/testdata/basics/textual_ir.carbon b/toolchain/check/testdata/basics/textual_ir.carbon index c8a5158e9bde..49772975f2bd 100644 --- a/toolchain/check/testdata/basics/textual_ir.carbon +++ b/toolchain/check/testdata/basics/textual_ir.carbon @@ -31,9 +31,9 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: %.loc12_13: i32 = add %n.ref, %.loc12_15 // CHECK:STDOUT: %.loc12_18: f64 = real_literal 34e-1 // CHECK:STDOUT: %.loc12_21.1: (i32, f64) = tuple_literal (%.loc12_13, %.loc12_18) -// CHECK:STDOUT: %.loc12_21.2: ref i32 = tuple_access %return, member0 +// CHECK:STDOUT: %.loc12_21.2: ref i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc12_21.3: init i32 = initialize_from %.loc12_13 to %.loc12_21.2 -// CHECK:STDOUT: %.loc12_21.4: ref f64 = tuple_access %return, member1 +// CHECK:STDOUT: %.loc12_21.4: ref f64 = tuple_access %return, element1 // CHECK:STDOUT: %.loc12_21.5: init f64 = initialize_from %.loc12_18 to %.loc12_21.4 // CHECK:STDOUT: %.loc12_21.6: init (i32, f64) = tuple_init (%.loc12_21.3, %.loc12_21.5) to %return // CHECK:STDOUT: %.loc12_21.7: init (i32, f64) = converted %.loc12_21.1, %.loc12_21.6 diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index cd657048e633..f5bf5372a79d 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -38,8 +38,8 @@ fn Run() -> i32 { // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %G: = fn_decl @G -// CHECK:STDOUT: %.loc14_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc14_8.2: = field k, member0 +// CHECK:STDOUT: %.loc14_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc14_8.2: = field k, element0 // CHECK:STDOUT: %k: = bind_name k, %.loc14_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index be436573a1bd..5a21212b8221 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -29,8 +29,8 @@ fn Make() -> Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field k, member0 +// CHECK:STDOUT: %.loc8_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc8_8.2: = field k, element0 // CHECK:STDOUT: %k: = bind_name k, %.loc8_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index 5d7b654d80a2..b628bb84dd8d 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -41,11 +41,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field a, member0 +// CHECK:STDOUT: %.loc8_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc8_8.2: = field a, element0 // CHECK:STDOUT: %a: = bind_name a, %.loc8_8.2 -// CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc9_8.2: = field b, member1 +// CHECK:STDOUT: %.loc9_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc9_8.2: = field b, element1 // CHECK:STDOUT: %b: = bind_name b, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -66,7 +66,7 @@ fn F() { // CHECK:STDOUT: %.loc20_18.1: {.a: i32, .c: i32} = struct_literal (%.loc20_9, %.loc20_17) // CHECK:STDOUT: %Class.ref.loc20: type = name_ref Class, file.%Class // CHECK:STDOUT: %.loc20_18.2: ref Class = temporary_storage -// CHECK:STDOUT: %.loc20_18.3: ref i32 = class_field_access %.loc20_18.2, member0 +// CHECK:STDOUT: %.loc20_18.3: ref i32 = class_element_access %.loc20_18.2, element0 // CHECK:STDOUT: %.loc20_18.4: init i32 = initialize_from %.loc20_9 to %.loc20_18.3 // CHECK:STDOUT: %.loc20_18.5: ref Class = temporary %.loc20_18.2, // CHECK:STDOUT: %.loc20_18.6: ref Class = converted %.loc20_18.1, %.loc20_18.5 diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index a2580c967e63..0d4e197def2b 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -38,11 +38,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field a, member0 +// CHECK:STDOUT: %.loc8_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc8_8.2: = field a, element0 // CHECK:STDOUT: %a: = bind_name a, %.loc8_8.2 -// CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc9_8.2: = field b, member1 +// CHECK:STDOUT: %.loc9_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc9_8.2: = field b, element1 // CHECK:STDOUT: %b: = bind_name b, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -62,9 +62,9 @@ fn F() { // CHECK:STDOUT: %.loc21_33.1: {.a: i32, .b: i32} = struct_literal (%.loc21_24, %.loc21_32) // CHECK:STDOUT: %Class.ref.loc21_38: type = name_ref Class, file.%Class // CHECK:STDOUT: %.loc21_33.2: ref Class = temporary_storage -// CHECK:STDOUT: %.loc21_33.3: ref i32 = class_field_access %.loc21_33.2, member0 +// CHECK:STDOUT: %.loc21_33.3: ref i32 = class_element_access %.loc21_33.2, element0 // CHECK:STDOUT: %.loc21_33.4: init i32 = initialize_from %.loc21_24 to %.loc21_33.3 -// CHECK:STDOUT: %.loc21_33.5: ref i32 = class_field_access %.loc21_33.2, member1 +// CHECK:STDOUT: %.loc21_33.5: ref i32 = class_element_access %.loc21_33.2, element1 // CHECK:STDOUT: %.loc21_33.6: init i32 = initialize_from %.loc21_32 to %.loc21_33.5 // CHECK:STDOUT: %.loc21_33.7: init Class = class_init (%.loc21_33.4, %.loc21_33.6), %.loc21_33.2 // CHECK:STDOUT: %.loc21_33.8: ref Class = temporary %.loc21_33.2, %.loc21_33.7 diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index b23c8ec1d832..4e4a838c8b60 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -61,8 +61,8 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A -// CHECK:STDOUT: %.loc12_8.1: type = unbound_field_type B, A -// CHECK:STDOUT: %.loc12_8.2: = field a, member0 +// CHECK:STDOUT: %.loc12_8.1: type = unbound_element_type B, A +// CHECK:STDOUT: %.loc12_8.2: = field a, element0 // CHECK:STDOUT: %a: = bind_name a, %.loc12_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -74,11 +74,11 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: fn @F.2(%s: {.a: A}, %b: B) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: {.a: A} = name_ref s, %s -// CHECK:STDOUT: %.loc23_4: A = struct_access %s.ref, member0 +// CHECK:STDOUT: %.loc23_4: A = struct_access %s.ref, element0 // CHECK:STDOUT: %.loc23_6: = bound_method %.loc23_4, @A.%F // CHECK:STDOUT: %.loc23_8: init () = call %.loc23_6() // CHECK:STDOUT: %b.ref: B = name_ref b, %b -// CHECK:STDOUT: %.loc33_4.1: ref A = class_field_access %b.ref, member0 +// CHECK:STDOUT: %.loc33_4.1: ref A = class_element_access %b.ref, element0 // CHECK:STDOUT: %.loc33_4.2: A = bind_value %.loc33_4.1 // CHECK:STDOUT: %.loc33_6: = bound_method %.loc33_4.2, @A.%F // CHECK:STDOUT: %.loc33_8: init () = call %.loc33_6() diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 27dbbb8f5d14..1dec25b95e69 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -34,8 +34,8 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %.loc8_12.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_12.2: = field field, member0 +// CHECK:STDOUT: %.loc8_12.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc8_12.2: = field field, element0 // CHECK:STDOUT: %field: = bind_name field, %.loc8_12.2 // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index 466e8b34d3d5..1ee43d952d95 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -30,8 +30,8 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field n, member0 +// CHECK:STDOUT: %.loc8_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc8_8.2: = field n, element0 // CHECK:STDOUT: %n: = bind_name n, %.loc8_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 174096b9aeed..e7585824073c 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -30,11 +30,11 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field j, member0 +// CHECK:STDOUT: %.loc8_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc8_8.2: = field j, element0 // CHECK:STDOUT: %j: = bind_name j, %.loc8_8.2 -// CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc9_8.2: = field k, member1 +// CHECK:STDOUT: %.loc9_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc9_8.2: = field k, element1 // CHECK:STDOUT: %k: = bind_name k, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -48,17 +48,17 @@ fn Run() -> i32 { // CHECK:STDOUT: %c.var: ref Class = var c // CHECK:STDOUT: %c: ref Class = bind_name c, %c.var // CHECK:STDOUT: %c.ref.loc14: ref Class = name_ref c, %c -// CHECK:STDOUT: %.loc14_4: ref i32 = class_field_access %c.ref.loc14, member0 +// CHECK:STDOUT: %.loc14_4: ref i32 = class_element_access %c.ref.loc14, element0 // CHECK:STDOUT: %.loc14_9: i32 = int_literal 1 // CHECK:STDOUT: assign %.loc14_4, %.loc14_9 // CHECK:STDOUT: %c.ref.loc15: ref Class = name_ref c, %c -// CHECK:STDOUT: %.loc15_4: ref i32 = class_field_access %c.ref.loc15, member1 +// CHECK:STDOUT: %.loc15_4: ref i32 = class_element_access %c.ref.loc15, element1 // CHECK:STDOUT: %.loc15_9: i32 = int_literal 2 // CHECK:STDOUT: assign %.loc15_4, %.loc15_9 // CHECK:STDOUT: %c.ref.loc16_10: ref Class = name_ref c, %c -// CHECK:STDOUT: %.loc16_11.1: ref i32 = class_field_access %c.ref.loc16_10, member0 +// CHECK:STDOUT: %.loc16_11.1: ref i32 = class_element_access %c.ref.loc16_10, element0 // CHECK:STDOUT: %c.ref.loc16_16: ref Class = name_ref c, %c -// CHECK:STDOUT: %.loc16_17.1: ref i32 = class_field_access %c.ref.loc16_16, member1 +// CHECK:STDOUT: %.loc16_17.1: ref i32 = class_element_access %c.ref.loc16_16, element1 // CHECK:STDOUT: %.loc16_11.2: i32 = bind_value %.loc16_11.1 // CHECK:STDOUT: %.loc16_17.2: i32 = bind_value %.loc16_17.1 // CHECK:STDOUT: %.loc16_14: i32 = add %.loc16_11.2, %.loc16_17.2 diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 6d039a0b30b9..008992e2f239 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -31,11 +31,11 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field j, member0 +// CHECK:STDOUT: %.loc8_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc8_8.2: = field j, element0 // CHECK:STDOUT: %j: = bind_name j, %.loc8_8.2 -// CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc9_8.2: = field k, member1 +// CHECK:STDOUT: %.loc9_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc9_8.2: = field k, element1 // CHECK:STDOUT: %k: = bind_name k, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -49,11 +49,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %cv.var: ref Class = var cv // CHECK:STDOUT: %cv: ref Class = bind_name cv, %cv.var // CHECK:STDOUT: %cv.ref.loc14: ref Class = name_ref cv, %cv -// CHECK:STDOUT: %.loc14_5: ref i32 = class_field_access %cv.ref.loc14, member0 +// CHECK:STDOUT: %.loc14_5: ref i32 = class_element_access %cv.ref.loc14, element0 // CHECK:STDOUT: %.loc14_10: i32 = int_literal 1 // CHECK:STDOUT: assign %.loc14_5, %.loc14_10 // CHECK:STDOUT: %cv.ref.loc15: ref Class = name_ref cv, %cv -// CHECK:STDOUT: %.loc15_5: ref i32 = class_field_access %cv.ref.loc15, member1 +// CHECK:STDOUT: %.loc15_5: ref i32 = class_element_access %cv.ref.loc15, element1 // CHECK:STDOUT: %.loc15_10: i32 = int_literal 2 // CHECK:STDOUT: assign %.loc15_5, %.loc15_10 // CHECK:STDOUT: %Class.ref.loc16: type = name_ref Class, file.%Class @@ -61,10 +61,10 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc16: Class = bind_value %cv.ref.loc16 // CHECK:STDOUT: %c: Class = bind_name c, %.loc16 // CHECK:STDOUT: %c.ref.loc17_10: Class = name_ref c, %c -// CHECK:STDOUT: %.loc17_11.1: ref i32 = class_field_access %c.ref.loc17_10, member0 +// CHECK:STDOUT: %.loc17_11.1: ref i32 = class_element_access %c.ref.loc17_10, element0 // CHECK:STDOUT: %.loc17_11.2: i32 = bind_value %.loc17_11.1 // CHECK:STDOUT: %c.ref.loc17_16: Class = name_ref c, %c -// CHECK:STDOUT: %.loc17_17.1: ref i32 = class_field_access %c.ref.loc17_16, member1 +// CHECK:STDOUT: %.loc17_17.1: ref i32 = class_element_access %c.ref.loc17_16, element1 // CHECK:STDOUT: %.loc17_17.2: i32 = bind_value %.loc17_17.1 // CHECK:STDOUT: %.loc17_14: i32 = add %.loc17_11.2, %.loc17_17.2 // CHECK:STDOUT: return %.loc17_14 diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 94ccbdfb1a92..c04bfc0654d7 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -33,13 +33,13 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field n, member0 +// CHECK:STDOUT: %.loc8_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc8_8.2: = field n, element0 // CHECK:STDOUT: %n: = bind_name n, %.loc8_8.2 // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class // CHECK:STDOUT: %.loc9_18: type = ptr_type Class -// CHECK:STDOUT: %.loc9_11.1: type = unbound_field_type Class, Class* -// CHECK:STDOUT: %.loc9_11.2: = field next, member1 +// CHECK:STDOUT: %.loc9_11.1: type = unbound_element_type Class, Class* +// CHECK:STDOUT: %.loc9_11.2: = field next, element1 // CHECK:STDOUT: %next: = bind_name next, %.loc9_11.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -52,9 +52,9 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: %next.ref: Class* = name_ref next, %next // CHECK:STDOUT: %.loc13_31.1: {.n: i32, .next: Class*} = struct_literal (%n.ref, %next.ref) -// CHECK:STDOUT: %.loc13_31.2: ref i32 = class_field_access %return, member0 +// CHECK:STDOUT: %.loc13_31.2: ref i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc13_31.3: init i32 = initialize_from %n.ref to %.loc13_31.2 -// CHECK:STDOUT: %.loc13_31.4: ref Class* = class_field_access %return, member1 +// CHECK:STDOUT: %.loc13_31.4: ref Class* = class_element_access %return, element1 // CHECK:STDOUT: %.loc13_31.5: init Class* = initialize_from %next.ref to %.loc13_31.4 // CHECK:STDOUT: %.loc13_31.6: init Class = class_init (%.loc13_31.3, %.loc13_31.5), %return // CHECK:STDOUT: %.loc13_31.7: init Class = converted %.loc13_31.1, %.loc13_31.6 @@ -66,9 +66,9 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %next.ref: Class* = name_ref next, %next // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n // CHECK:STDOUT: %.loc17_31.1: {.next: Class*, .n: i32} = struct_literal (%next.ref, %n.ref) -// CHECK:STDOUT: %.loc17_31.2: ref i32 = class_field_access %return, member1 +// CHECK:STDOUT: %.loc17_31.2: ref i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc17_31.3: init i32 = initialize_from %n.ref to %.loc17_31.2 -// CHECK:STDOUT: %.loc17_31.4: ref Class* = class_field_access %return, member0 +// CHECK:STDOUT: %.loc17_31.4: ref Class* = class_element_access %return, element0 // CHECK:STDOUT: %.loc17_31.5: init Class* = initialize_from %next.ref to %.loc17_31.4 // CHECK:STDOUT: %.loc17_31.6: init Class = class_init (%.loc17_31.3, %.loc17_31.5), %return // CHECK:STDOUT: %.loc17_31.7: init Class = converted %.loc17_31.1, %.loc17_31.6 diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 94282aac6bf7..c4bc96986868 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -27,11 +27,11 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field a, member0 +// CHECK:STDOUT: %.loc8_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc8_8.2: = field a, element0 // CHECK:STDOUT: %a: = bind_name a, %.loc8_8.2 -// CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc9_8.2: = field b, member1 +// CHECK:STDOUT: %.loc9_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc9_8.2: = field b, element1 // CHECK:STDOUT: %b: = bind_name b, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -46,14 +46,14 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc13_26.1: {.a: i32, .b: i32} = struct_literal (%.loc13_17, %.loc13_25) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class // CHECK:STDOUT: %.loc13_26.2: ref Class = temporary_storage -// CHECK:STDOUT: %.loc13_26.3: ref i32 = class_field_access %.loc13_26.2, member0 +// CHECK:STDOUT: %.loc13_26.3: ref i32 = class_element_access %.loc13_26.2, element0 // CHECK:STDOUT: %.loc13_26.4: init i32 = initialize_from %.loc13_17 to %.loc13_26.3 -// CHECK:STDOUT: %.loc13_26.5: ref i32 = class_field_access %.loc13_26.2, member1 +// CHECK:STDOUT: %.loc13_26.5: ref i32 = class_element_access %.loc13_26.2, element1 // CHECK:STDOUT: %.loc13_26.6: init i32 = initialize_from %.loc13_25 to %.loc13_26.5 // CHECK:STDOUT: %.loc13_26.7: init Class = class_init (%.loc13_26.4, %.loc13_26.6), %.loc13_26.2 // CHECK:STDOUT: %.loc13_26.8: ref Class = temporary %.loc13_26.2, %.loc13_26.7 // CHECK:STDOUT: %.loc13_26.9: ref Class = converted %.loc13_26.1, %.loc13_26.8 -// CHECK:STDOUT: %.loc13_37.1: ref i32 = class_field_access %.loc13_26.9, member0 +// CHECK:STDOUT: %.loc13_37.1: ref i32 = class_element_access %.loc13_26.9, element0 // CHECK:STDOUT: %.loc13_37.2: i32 = bind_value %.loc13_37.1 // CHECK:STDOUT: return %.loc13_37.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index c883a741df68..656b0eeb8b92 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -41,11 +41,11 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { -// CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Inner, i32 -// CHECK:STDOUT: %.loc8_8.2: = field a, member0 +// CHECK:STDOUT: %.loc8_8.1: type = unbound_element_type Inner, i32 +// CHECK:STDOUT: %.loc8_8.2: = field a, element0 // CHECK:STDOUT: %a: = bind_name a, %.loc8_8.2 -// CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Inner, i32 -// CHECK:STDOUT: %.loc9_8.2: = field b, member1 +// CHECK:STDOUT: %.loc9_8.1: type = unbound_element_type Inner, i32 +// CHECK:STDOUT: %.loc9_8.2: = field b, element1 // CHECK:STDOUT: %b: = bind_name b, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -55,12 +55,12 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { // CHECK:STDOUT: %Inner.ref.loc15: type = name_ref Inner, file.%Inner -// CHECK:STDOUT: %.loc15_8.1: type = unbound_field_type Outer, Inner -// CHECK:STDOUT: %.loc15_8.2: = field c, member0 +// CHECK:STDOUT: %.loc15_8.1: type = unbound_element_type Outer, Inner +// CHECK:STDOUT: %.loc15_8.2: = field c, element0 // CHECK:STDOUT: %c: = bind_name c, %.loc15_8.2 // CHECK:STDOUT: %Inner.ref.loc16: type = name_ref Inner, file.%Inner -// CHECK:STDOUT: %.loc16_8.1: type = unbound_field_type Outer, Inner -// CHECK:STDOUT: %.loc16_8.2: = field d, member1 +// CHECK:STDOUT: %.loc16_8.1: type = unbound_element_type Outer, Inner +// CHECK:STDOUT: %.loc16_8.2: = field d, element1 // CHECK:STDOUT: %d: = bind_name d, %.loc16_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -73,10 +73,10 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: fn @MakeOuter() -> %return: Outer { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %MakeInner.ref.loc20_16: = name_ref MakeInner, file.%MakeInner -// CHECK:STDOUT: %.loc20_45.1: ref Inner = class_field_access %return, member0 +// CHECK:STDOUT: %.loc20_45.1: ref Inner = class_element_access %return, element0 // CHECK:STDOUT: %.loc20_25: init Inner = call %MakeInner.ref.loc20_16() to %.loc20_45.1 // CHECK:STDOUT: %MakeInner.ref.loc20_34: = name_ref MakeInner, file.%MakeInner -// CHECK:STDOUT: %.loc20_45.2: ref Inner = class_field_access %return, member1 +// CHECK:STDOUT: %.loc20_45.2: ref Inner = class_element_access %return, element1 // CHECK:STDOUT: %.loc20_43: init Inner = call %MakeInner.ref.loc20_34() to %.loc20_45.2 // CHECK:STDOUT: %.loc20_45.3: {.c: Inner, .d: Inner} = struct_literal (%.loc20_25, %.loc20_43) // CHECK:STDOUT: %.loc20_45.4: init Outer = class_init (%.loc20_25, %.loc20_43), %return diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index a10c26b0cf57..4128b31358dc 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -67,8 +67,8 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %G: = fn_decl @G -// CHECK:STDOUT: %.loc11_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc11_8.2: = field k, member0 +// CHECK:STDOUT: %.loc11_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc11_8.2: = field k, element0 // CHECK:STDOUT: %k: = bind_name k, %.loc11_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -80,7 +80,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: fn @F[%self: Class]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: Class = name_ref self, %self -// CHECK:STDOUT: %.loc15_14.1: ref i32 = class_field_access %self.ref, member0 +// CHECK:STDOUT: %.loc15_14.1: ref i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc15_14.2: i32 = bind_value %.loc15_14.1 // CHECK:STDOUT: return %.loc15_14.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index 785e910a0933..60016d8ea295 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -48,18 +48,18 @@ fn F(a: Outer*) { // CHECK:STDOUT: %Inner: type = class_type @Inner // CHECK:STDOUT: %Self.ref: type = name_ref Self, file.%Outer // CHECK:STDOUT: %.loc14_15: type = ptr_type Outer -// CHECK:STDOUT: %.loc14_9.1: type = unbound_field_type Outer, Outer* -// CHECK:STDOUT: %.loc14_9.2: = field po, member0 +// CHECK:STDOUT: %.loc14_9.1: type = unbound_element_type Outer, Outer* +// CHECK:STDOUT: %.loc14_9.2: = field po, element0 // CHECK:STDOUT: %po: = bind_name po, %.loc14_9.2 // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer // CHECK:STDOUT: %.loc15_16: type = ptr_type Outer -// CHECK:STDOUT: %.loc15_9.1: type = unbound_field_type Outer, Outer* -// CHECK:STDOUT: %.loc15_9.2: = field qo, member1 +// CHECK:STDOUT: %.loc15_9.1: type = unbound_element_type Outer, Outer* +// CHECK:STDOUT: %.loc15_9.2: = field qo, element1 // CHECK:STDOUT: %qo: = bind_name qo, %.loc15_9.2 // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %Inner // CHECK:STDOUT: %.loc16_16: type = ptr_type Inner -// CHECK:STDOUT: %.loc16_9.1: type = unbound_field_type Outer, Inner* -// CHECK:STDOUT: %.loc16_9.2: = field pi, member2 +// CHECK:STDOUT: %.loc16_9.1: type = unbound_element_type Outer, Inner* +// CHECK:STDOUT: %.loc16_9.2: = field pi, element2 // CHECK:STDOUT: %pi: = bind_name pi, %.loc16_9.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -72,18 +72,18 @@ fn F(a: Outer*) { // CHECK:STDOUT: class @Inner { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @Outer.%Inner // CHECK:STDOUT: %.loc9_17: type = ptr_type Inner -// CHECK:STDOUT: %.loc9_11.1: type = unbound_field_type Inner, Inner* -// CHECK:STDOUT: %.loc9_11.2: = field pi, member0 +// CHECK:STDOUT: %.loc9_11.1: type = unbound_element_type Inner, Inner* +// CHECK:STDOUT: %.loc9_11.2: = field pi, element0 // CHECK:STDOUT: %pi: = bind_name pi, %.loc9_11.2 // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer // CHECK:STDOUT: %.loc10_18: type = ptr_type Outer -// CHECK:STDOUT: %.loc10_11.1: type = unbound_field_type Inner, Outer* -// CHECK:STDOUT: %.loc10_11.2: = field po, member1 +// CHECK:STDOUT: %.loc10_11.1: type = unbound_element_type Inner, Outer* +// CHECK:STDOUT: %.loc10_11.2: = field po, element1 // CHECK:STDOUT: %po: = bind_name po, %.loc10_11.2 // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner // CHECK:STDOUT: %.loc11_18: type = ptr_type Inner -// CHECK:STDOUT: %.loc11_11.1: type = unbound_field_type Inner, Inner* -// CHECK:STDOUT: %.loc11_11.2: = field qi, member2 +// CHECK:STDOUT: %.loc11_11.1: type = unbound_element_type Inner, Inner* +// CHECK:STDOUT: %.loc11_11.2: = field qi, element2 // CHECK:STDOUT: %qi: = bind_name qi, %.loc11_11.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -96,50 +96,50 @@ fn F(a: Outer*) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref.loc23_5: Outer* = name_ref a, %a // CHECK:STDOUT: %.loc23_4: ref Outer = deref %a.ref.loc23_5 -// CHECK:STDOUT: %.loc23_7: ref Outer* = class_field_access %.loc23_4, member0 +// CHECK:STDOUT: %.loc23_7: ref Outer* = class_element_access %.loc23_4, element0 // CHECK:STDOUT: %a.ref.loc23_13: Outer* = name_ref a, %a // CHECK:STDOUT: assign %.loc23_7, %a.ref.loc23_13 // CHECK:STDOUT: %a.ref.loc24_5: Outer* = name_ref a, %a // CHECK:STDOUT: %.loc24_4: ref Outer = deref %a.ref.loc24_5 -// CHECK:STDOUT: %.loc24_7: ref Outer* = class_field_access %.loc24_4, member1 +// CHECK:STDOUT: %.loc24_7: ref Outer* = class_element_access %.loc24_4, element1 // CHECK:STDOUT: %a.ref.loc24_13: Outer* = name_ref a, %a // CHECK:STDOUT: assign %.loc24_7, %a.ref.loc24_13 // CHECK:STDOUT: %a.ref.loc25_5: Outer* = name_ref a, %a // CHECK:STDOUT: %.loc25_4: ref Outer = deref %a.ref.loc25_5 -// CHECK:STDOUT: %.loc25_7: ref Inner* = class_field_access %.loc25_4, member2 +// CHECK:STDOUT: %.loc25_7: ref Inner* = class_element_access %.loc25_4, element2 // CHECK:STDOUT: %a.ref.loc25_15: Outer* = name_ref a, %a // CHECK:STDOUT: %.loc25_14: ref Outer = deref %a.ref.loc25_15 -// CHECK:STDOUT: %.loc25_17.1: ref Inner* = class_field_access %.loc25_14, member2 +// CHECK:STDOUT: %.loc25_17.1: ref Inner* = class_element_access %.loc25_14, element2 // CHECK:STDOUT: %.loc25_17.2: Inner* = bind_value %.loc25_17.1 // CHECK:STDOUT: assign %.loc25_7, %.loc25_17.2 // CHECK:STDOUT: %a.ref.loc26_7: Outer* = name_ref a, %a // CHECK:STDOUT: %.loc26_6: ref Outer = deref %a.ref.loc26_7 -// CHECK:STDOUT: %.loc26_9.1: ref Inner* = class_field_access %.loc26_6, member2 +// CHECK:STDOUT: %.loc26_9.1: ref Inner* = class_element_access %.loc26_6, element2 // CHECK:STDOUT: %.loc26_9.2: Inner* = bind_value %.loc26_9.1 // CHECK:STDOUT: %.loc26_4: ref Inner = deref %.loc26_9.2 -// CHECK:STDOUT: %.loc26_13: ref Outer* = class_field_access %.loc26_4, member1 +// CHECK:STDOUT: %.loc26_13: ref Outer* = class_element_access %.loc26_4, element1 // CHECK:STDOUT: %a.ref.loc26_19: Outer* = name_ref a, %a // CHECK:STDOUT: assign %.loc26_13, %a.ref.loc26_19 // CHECK:STDOUT: %a.ref.loc27_7: Outer* = name_ref a, %a // CHECK:STDOUT: %.loc27_6: ref Outer = deref %a.ref.loc27_7 -// CHECK:STDOUT: %.loc27_9.1: ref Inner* = class_field_access %.loc27_6, member2 +// CHECK:STDOUT: %.loc27_9.1: ref Inner* = class_element_access %.loc27_6, element2 // CHECK:STDOUT: %.loc27_9.2: Inner* = bind_value %.loc27_9.1 // CHECK:STDOUT: %.loc27_4: ref Inner = deref %.loc27_9.2 -// CHECK:STDOUT: %.loc27_13: ref Inner* = class_field_access %.loc27_4, member0 +// CHECK:STDOUT: %.loc27_13: ref Inner* = class_element_access %.loc27_4, element0 // CHECK:STDOUT: %a.ref.loc27_21: Outer* = name_ref a, %a // CHECK:STDOUT: %.loc27_20: ref Outer = deref %a.ref.loc27_21 -// CHECK:STDOUT: %.loc27_23.1: ref Inner* = class_field_access %.loc27_20, member2 +// CHECK:STDOUT: %.loc27_23.1: ref Inner* = class_element_access %.loc27_20, element2 // CHECK:STDOUT: %.loc27_23.2: Inner* = bind_value %.loc27_23.1 // CHECK:STDOUT: assign %.loc27_13, %.loc27_23.2 // CHECK:STDOUT: %a.ref.loc28_7: Outer* = name_ref a, %a // CHECK:STDOUT: %.loc28_6: ref Outer = deref %a.ref.loc28_7 -// CHECK:STDOUT: %.loc28_9.1: ref Inner* = class_field_access %.loc28_6, member2 +// CHECK:STDOUT: %.loc28_9.1: ref Inner* = class_element_access %.loc28_6, element2 // CHECK:STDOUT: %.loc28_9.2: Inner* = bind_value %.loc28_9.1 // CHECK:STDOUT: %.loc28_4: ref Inner = deref %.loc28_9.2 -// CHECK:STDOUT: %.loc28_13: ref Inner* = class_field_access %.loc28_4, member2 +// CHECK:STDOUT: %.loc28_13: ref Inner* = class_element_access %.loc28_4, element2 // CHECK:STDOUT: %a.ref.loc28_21: Outer* = name_ref a, %a // CHECK:STDOUT: %.loc28_20: ref Outer = deref %a.ref.loc28_21 -// CHECK:STDOUT: %.loc28_23.1: ref Inner* = class_field_access %.loc28_20, member2 +// CHECK:STDOUT: %.loc28_23.1: ref Inner* = class_element_access %.loc28_20, element2 // CHECK:STDOUT: %.loc28_23.2: Inner* = bind_value %.loc28_23.1 // CHECK:STDOUT: assign %.loc28_13, %.loc28_23.2 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 529bff46fc9d..8bc021e5365e 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -44,8 +44,8 @@ fn G(o: Outer) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { -// CHECK:STDOUT: %.loc9_10.1: type = unbound_field_type Inner, i32 -// CHECK:STDOUT: %.loc9_10.2: = field n, member0 +// CHECK:STDOUT: %.loc9_10.1: type = unbound_element_type Inner, i32 +// CHECK:STDOUT: %.loc9_10.2: = field n, element0 // CHECK:STDOUT: %n: = bind_name n, %.loc9_10.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -55,7 +55,7 @@ fn G(o: Outer) { // CHECK:STDOUT: fn @F(%oi: Inner) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %oi.ref: Inner = name_ref oi, %oi -// CHECK:STDOUT: %.loc14_12.1: ref i32 = class_field_access %oi.ref, member0 +// CHECK:STDOUT: %.loc14_12.1: ref i32 = class_element_access %oi.ref, element0 // CHECK:STDOUT: %.loc14_12.2: i32 = bind_value %.loc14_12.1 // CHECK:STDOUT: return %.loc14_12.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index 65dfb6685f52..d2287b87605a 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -38,8 +38,8 @@ fn Class.G[self: Class](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %G: = fn_decl @G -// CHECK:STDOUT: %.loc10_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc10_8.2: = field n, member0 +// CHECK:STDOUT: %.loc10_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc10_8.2: = field n, element0 // CHECK:STDOUT: %n: = bind_name n, %.loc10_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -52,7 +52,7 @@ fn Class.G[self: Class](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc14_5: Class* = name_ref self, %self.addr // CHECK:STDOUT: %.loc14_4: ref Class = deref %self.ref.loc14_5 -// CHECK:STDOUT: %.loc14_10: ref i32 = class_field_access %.loc14_4, member0 +// CHECK:STDOUT: %.loc14_10: ref i32 = class_element_access %.loc14_4, element0 // CHECK:STDOUT: %self.ref.loc14_15: i32 = name_ref r#self, %self // CHECK:STDOUT: assign %.loc14_10, %self.ref.loc14_15 // CHECK:STDOUT: return @@ -61,13 +61,13 @@ fn Class.G[self: Class](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: fn @G[%self.loc17_12: Class](%self.loc17_25: i32) -> %return: (i32, i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc18_11: Class = name_ref self, %self.loc17_12 -// CHECK:STDOUT: %.loc18_15.1: ref i32 = class_field_access %self.ref.loc18_11, member0 +// CHECK:STDOUT: %.loc18_15.1: ref i32 = class_element_access %self.ref.loc18_11, element0 // CHECK:STDOUT: %.loc18_15.2: i32 = bind_value %.loc18_15.1 // CHECK:STDOUT: %self.ref.loc18_19: i32 = name_ref r#self, %self.loc17_25 // CHECK:STDOUT: %.loc18_25.1: (i32, i32) = tuple_literal (%.loc18_15.2, %self.ref.loc18_19) -// CHECK:STDOUT: %.loc18_25.2: ref i32 = tuple_access %return, member0 +// CHECK:STDOUT: %.loc18_25.2: ref i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc18_25.3: init i32 = initialize_from %.loc18_15.2 to %.loc18_25.2 -// CHECK:STDOUT: %.loc18_25.4: ref i32 = tuple_access %return, member1 +// CHECK:STDOUT: %.loc18_25.4: ref i32 = tuple_access %return, element1 // CHECK:STDOUT: %.loc18_25.5: init i32 = initialize_from %self.ref.loc18_19 to %.loc18_25.4 // CHECK:STDOUT: %.loc18_25.6: init (i32, i32) = tuple_init (%.loc18_25.3, %.loc18_25.5) to %return // CHECK:STDOUT: %.loc18_25.7: init (i32, i32) = converted %.loc18_25.1, %.loc18_25.6 diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 9c706ee99318..b921e820e821 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -36,8 +36,8 @@ fn Class.G[addr self: Class*]() -> i32 { // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %G: = fn_decl @G -// CHECK:STDOUT: %.loc11_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc11_8.2: = field n, member0 +// CHECK:STDOUT: %.loc11_8.1: type = unbound_element_type Class, i32 +// CHECK:STDOUT: %.loc11_8.2: = field n, element0 // CHECK:STDOUT: %n: = bind_name n, %.loc11_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -49,7 +49,7 @@ fn Class.G[addr self: Class*]() -> i32 { // CHECK:STDOUT: fn @F[%self: Class]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: Class = name_ref self, %self -// CHECK:STDOUT: %.loc15_14.1: ref i32 = class_field_access %self.ref, member0 +// CHECK:STDOUT: %.loc15_14.1: ref i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc15_14.2: i32 = bind_value %.loc15_14.1 // CHECK:STDOUT: return %.loc15_14.2 // CHECK:STDOUT: } @@ -58,7 +58,7 @@ fn Class.G[addr self: Class*]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: Class* = name_ref self, %self.addr // CHECK:STDOUT: %.loc19_11: ref Class = deref %self.ref -// CHECK:STDOUT: %.loc19_17.1: ref i32 = class_field_access %.loc19_11, member0 +// CHECK:STDOUT: %.loc19_17.1: ref i32 = class_element_access %.loc19_11, element0 // CHECK:STDOUT: %.loc19_17.2: i32 = bind_value %.loc19_17.1 // CHECK:STDOUT: return %.loc19_17.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index afafd26dcc15..c8f6f837d3b8 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -33,8 +33,8 @@ fn Class.F[self: Class]() -> i32 { // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %Self.ref: type = name_ref Self, file.%Class // CHECK:STDOUT: %.loc9_14: type = ptr_type Class -// CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, Class* -// CHECK:STDOUT: %.loc9_8.2: = field p, member0 +// CHECK:STDOUT: %.loc9_8.1: type = unbound_element_type Class, Class* +// CHECK:STDOUT: %.loc9_8.2: = field p, element0 // CHECK:STDOUT: %p: = bind_name p, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -45,7 +45,7 @@ fn Class.F[self: Class]() -> i32 { // CHECK:STDOUT: fn @F[%self: Class]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: Class = name_ref self, %self -// CHECK:STDOUT: %.loc16_16.1: ref Class* = class_field_access %self.ref, member0 +// CHECK:STDOUT: %.loc16_16.1: ref Class* = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc16_16.2: Class* = bind_value %.loc16_16.1 // CHECK:STDOUT: %.loc16_11.1: ref Class = deref %.loc16_16.2 // CHECK:STDOUT: %.loc16_19: = bound_method %.loc16_11.1, @Class.%F diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 56229cc6bdfa..6f2eefa4ad11 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -33,9 +33,9 @@ fn F(cond: bool) { // CHECK:STDOUT: %.loc10_37: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_45: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_46.1: {.a: i32, .b: i32} = struct_literal (%.loc10_37, %.loc10_45) -// CHECK:STDOUT: %.loc10_46.2: ref i32 = struct_access %a.var, member0 +// CHECK:STDOUT: %.loc10_46.2: ref i32 = struct_access %a.var, element0 // CHECK:STDOUT: %.loc10_46.3: init i32 = initialize_from %.loc10_37 to %.loc10_46.2 -// CHECK:STDOUT: %.loc10_46.4: ref i32 = struct_access %a.var, member1 +// CHECK:STDOUT: %.loc10_46.4: ref i32 = struct_access %a.var, element1 // CHECK:STDOUT: %.loc10_46.5: init i32 = initialize_from %.loc10_45 to %.loc10_46.4 // CHECK:STDOUT: %.loc10_46.6: init {.a: i32, .b: i32} = struct_init (%.loc10_46.3, %.loc10_46.5) to %a.var // CHECK:STDOUT: %.loc10_46.7: init {.a: i32, .b: i32} = converted %.loc10_46.1, %.loc10_46.6 @@ -46,9 +46,9 @@ fn F(cond: bool) { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: // CHECK:STDOUT: %a.ref.loc11_18: ref {.a: i32, .b: i32} = name_ref a, %a -// CHECK:STDOUT: %.loc11_18.1: ref i32 = struct_access %a.ref.loc11_18, member0 +// CHECK:STDOUT: %.loc11_18.1: ref i32 = struct_access %a.ref.loc11_18, element0 // CHECK:STDOUT: %.loc11_18.2: i32 = bind_value %.loc11_18.1 -// CHECK:STDOUT: %.loc11_18.3: ref i32 = struct_access %a.ref.loc11_18, member1 +// CHECK:STDOUT: %.loc11_18.3: ref i32 = struct_access %a.ref.loc11_18, element1 // CHECK:STDOUT: %.loc11_18.4: i32 = bind_value %.loc11_18.3 // CHECK:STDOUT: %.loc11_18.5: {.a: i32, .b: i32} = struct_value (%.loc11_18.2, %.loc11_18.4) // CHECK:STDOUT: %.loc11_18.6: {.a: i32, .b: i32} = converted %a.ref.loc11_18, %.loc11_18.5 @@ -56,9 +56,9 @@ fn F(cond: bool) { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: // CHECK:STDOUT: %a.ref.loc11_25: ref {.a: i32, .b: i32} = name_ref a, %a -// CHECK:STDOUT: %.loc11_25.1: ref i32 = struct_access %a.ref.loc11_25, member0 +// CHECK:STDOUT: %.loc11_25.1: ref i32 = struct_access %a.ref.loc11_25, element0 // CHECK:STDOUT: %.loc11_25.2: i32 = bind_value %.loc11_25.1 -// CHECK:STDOUT: %.loc11_25.3: ref i32 = struct_access %a.ref.loc11_25, member1 +// CHECK:STDOUT: %.loc11_25.3: ref i32 = struct_access %a.ref.loc11_25, element1 // CHECK:STDOUT: %.loc11_25.4: i32 = bind_value %.loc11_25.3 // CHECK:STDOUT: %.loc11_25.5: {.a: i32, .b: i32} = struct_value (%.loc11_25.2, %.loc11_25.4) // CHECK:STDOUT: %.loc11_25.6: {.a: i32, .b: i32} = converted %a.ref.loc11_25, %.loc11_25.5 diff --git a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon index 06e7de1c7a52..361fdacc72e4 100644 --- a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon @@ -27,9 +27,9 @@ var c: i32 = a[b]; // CHECK:STDOUT: %.loc7_22: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_25: i32 = int_literal 3 // CHECK:STDOUT: %.loc7_26.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_25) -// CHECK:STDOUT: %.loc7_26.2: ref i32 = tuple_access %a.var, member0 +// CHECK:STDOUT: %.loc7_26.2: ref i32 = tuple_access %a.var, element0 // CHECK:STDOUT: %.loc7_26.3: init i32 = initialize_from %.loc7_22 to %.loc7_26.2 -// CHECK:STDOUT: %.loc7_26.4: ref i32 = tuple_access %a.var, member1 +// CHECK:STDOUT: %.loc7_26.4: ref i32 = tuple_access %a.var, element1 // CHECK:STDOUT: %.loc7_26.5: init i32 = initialize_from %.loc7_25 to %.loc7_26.4 // CHECK:STDOUT: %.loc7_26.6: init (i32, i32) = tuple_init (%.loc7_26.3, %.loc7_26.5) to %a.var // CHECK:STDOUT: %.loc7_26.7: init (i32, i32) = converted %.loc7_26.1, %.loc7_26.6 diff --git a/toolchain/check/testdata/index/fail_tuple_index_error.carbon b/toolchain/check/testdata/index/fail_tuple_index_error.carbon index e2cd5a855ba5..54cf4fc43360 100644 --- a/toolchain/check/testdata/index/fail_tuple_index_error.carbon +++ b/toolchain/check/testdata/index/fail_tuple_index_error.carbon @@ -26,9 +26,9 @@ var b: i32 = a[oops]; // CHECK:STDOUT: %.loc7_22: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_26: i32 = int_literal 6 // CHECK:STDOUT: %.loc7_27.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_26) -// CHECK:STDOUT: %.loc7_27.2: ref i32 = tuple_access %a.var, member0 +// CHECK:STDOUT: %.loc7_27.2: ref i32 = tuple_access %a.var, element0 // CHECK:STDOUT: %.loc7_27.3: init i32 = initialize_from %.loc7_22 to %.loc7_27.2 -// CHECK:STDOUT: %.loc7_27.4: ref i32 = tuple_access %a.var, member1 +// CHECK:STDOUT: %.loc7_27.4: ref i32 = tuple_access %a.var, element1 // CHECK:STDOUT: %.loc7_27.5: init i32 = initialize_from %.loc7_26 to %.loc7_27.4 // CHECK:STDOUT: %.loc7_27.6: init (i32, i32) = tuple_init (%.loc7_27.3, %.loc7_27.5) to %a.var // CHECK:STDOUT: %.loc7_27.7: init (i32, i32) = converted %.loc7_27.1, %.loc7_27.6 diff --git a/toolchain/check/testdata/index/fail_tuple_large_index.carbon b/toolchain/check/testdata/index/fail_tuple_large_index.carbon index bca0a6cfbc0e..776e898d8a7e 100644 --- a/toolchain/check/testdata/index/fail_tuple_large_index.carbon +++ b/toolchain/check/testdata/index/fail_tuple_large_index.carbon @@ -33,7 +33,7 @@ var c: i32 = b[0xFFFFFFFFFFFFFFFFF]; // CHECK:STDOUT: %b.var: ref (i32,) = var b // CHECK:STDOUT: %b: ref (i32,) = bind_name b, %b.var // CHECK:STDOUT: %a.ref: ref (i32,) = name_ref a, %a -// CHECK:STDOUT: %.loc8_17.1: ref i32 = tuple_access %a.ref, member0 +// CHECK:STDOUT: %.loc8_17.1: ref i32 = tuple_access %a.ref, element0 // CHECK:STDOUT: %.loc8_17.2: i32 = bind_value %.loc8_17.1 // CHECK:STDOUT: %.loc8_17.3: init (i32,) = tuple_init (%.loc8_17.2) to %b.var // CHECK:STDOUT: %.loc8_17.4: init (i32,) = converted %a.ref, %.loc8_17.3 diff --git a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon index 2e3de4397274..c812d4e8577b 100644 --- a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon @@ -26,9 +26,9 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %.loc7_22: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_26: i32 = int_literal 6 // CHECK:STDOUT: %.loc7_27.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_26) -// CHECK:STDOUT: %.loc7_27.2: ref i32 = tuple_access %a.var, member0 +// CHECK:STDOUT: %.loc7_27.2: ref i32 = tuple_access %a.var, element0 // CHECK:STDOUT: %.loc7_27.3: init i32 = initialize_from %.loc7_22 to %.loc7_27.2 -// CHECK:STDOUT: %.loc7_27.4: ref i32 = tuple_access %a.var, member1 +// CHECK:STDOUT: %.loc7_27.4: ref i32 = tuple_access %a.var, element1 // CHECK:STDOUT: %.loc7_27.5: init i32 = initialize_from %.loc7_26 to %.loc7_27.4 // CHECK:STDOUT: %.loc7_27.6: init (i32, i32) = tuple_init (%.loc7_27.3, %.loc7_27.5) to %a.var // CHECK:STDOUT: %.loc7_27.7: init (i32, i32) = converted %.loc7_27.1, %.loc7_27.6 diff --git a/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon index 087b7e4ae2ca..ca830153ed00 100644 --- a/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon @@ -26,9 +26,9 @@ var b: i32 = a[2]; // CHECK:STDOUT: %.loc7_22: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_26: i32 = int_literal 6 // CHECK:STDOUT: %.loc7_27.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_26) -// CHECK:STDOUT: %.loc7_27.2: ref i32 = tuple_access %a.var, member0 +// CHECK:STDOUT: %.loc7_27.2: ref i32 = tuple_access %a.var, element0 // CHECK:STDOUT: %.loc7_27.3: init i32 = initialize_from %.loc7_22 to %.loc7_27.2 -// CHECK:STDOUT: %.loc7_27.4: ref i32 = tuple_access %a.var, member1 +// CHECK:STDOUT: %.loc7_27.4: ref i32 = tuple_access %a.var, element1 // CHECK:STDOUT: %.loc7_27.5: init i32 = initialize_from %.loc7_26 to %.loc7_27.4 // CHECK:STDOUT: %.loc7_27.6: init (i32, i32) = tuple_init (%.loc7_27.3, %.loc7_27.5) to %a.var // CHECK:STDOUT: %.loc7_27.7: init (i32, i32) = converted %.loc7_27.1, %.loc7_27.6 diff --git a/toolchain/check/testdata/index/tuple_element_access.carbon b/toolchain/check/testdata/index/tuple_element_access.carbon index a350093a5d46..72ab79526be1 100644 --- a/toolchain/check/testdata/index/tuple_element_access.carbon +++ b/toolchain/check/testdata/index/tuple_element_access.carbon @@ -30,7 +30,7 @@ var c: i32 = b[0]; // CHECK:STDOUT: %b.var: ref (i32,) = var b // CHECK:STDOUT: %b: ref (i32,) = bind_name b, %b.var // CHECK:STDOUT: %a.ref: ref (i32,) = name_ref a, %a -// CHECK:STDOUT: %.loc8_17.1: ref i32 = tuple_access %a.ref, member0 +// CHECK:STDOUT: %.loc8_17.1: ref i32 = tuple_access %a.ref, element0 // CHECK:STDOUT: %.loc8_17.2: i32 = bind_value %.loc8_17.1 // CHECK:STDOUT: %.loc8_17.3: init (i32,) = tuple_init (%.loc8_17.2) to %b.var // CHECK:STDOUT: %.loc8_17.4: init (i32,) = converted %a.ref, %.loc8_17.3 diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index 68ae71a68769..c04344374b53 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -33,11 +33,11 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc8_32: i32 = int_literal 2 // CHECK:STDOUT: %.loc8_35: i32 = int_literal 3 // CHECK:STDOUT: %.loc8_36.1: (i32, i32, i32) = tuple_literal (%.loc8_29, %.loc8_32, %.loc8_35) -// CHECK:STDOUT: %.loc8_36.2: ref i32 = tuple_access %v.var, member0 +// CHECK:STDOUT: %.loc8_36.2: ref i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc8_36.3: init i32 = initialize_from %.loc8_29 to %.loc8_36.2 -// CHECK:STDOUT: %.loc8_36.4: ref i32 = tuple_access %v.var, member1 +// CHECK:STDOUT: %.loc8_36.4: ref i32 = tuple_access %v.var, element1 // CHECK:STDOUT: %.loc8_36.5: init i32 = initialize_from %.loc8_32 to %.loc8_36.4 -// CHECK:STDOUT: %.loc8_36.6: ref i32 = tuple_access %v.var, member2 +// CHECK:STDOUT: %.loc8_36.6: ref i32 = tuple_access %v.var, element2 // CHECK:STDOUT: %.loc8_36.7: init i32 = initialize_from %.loc8_35 to %.loc8_36.6 // CHECK:STDOUT: %.loc8_36.8: init (i32, i32, i32) = tuple_init (%.loc8_36.3, %.loc8_36.5, %.loc8_36.7) to %v.var // CHECK:STDOUT: %.loc8_36.9: init (i32, i32, i32) = converted %.loc8_36.1, %.loc8_36.8 @@ -45,11 +45,11 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc10_24: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc8_24.3: type = converted %.loc10_24, constants.%.loc8_24.2 // CHECK:STDOUT: %v.ref: ref (i32, i32, i32) = name_ref v, %v -// CHECK:STDOUT: %.loc10_28.1: ref i32 = tuple_access %v.ref, member0 +// CHECK:STDOUT: %.loc10_28.1: ref i32 = tuple_access %v.ref, element0 // CHECK:STDOUT: %.loc10_28.2: i32 = bind_value %.loc10_28.1 -// CHECK:STDOUT: %.loc10_28.3: ref i32 = tuple_access %v.ref, member1 +// CHECK:STDOUT: %.loc10_28.3: ref i32 = tuple_access %v.ref, element1 // CHECK:STDOUT: %.loc10_28.4: i32 = bind_value %.loc10_28.3 -// CHECK:STDOUT: %.loc10_28.5: ref i32 = tuple_access %v.ref, member2 +// CHECK:STDOUT: %.loc10_28.5: ref i32 = tuple_access %v.ref, element2 // CHECK:STDOUT: %.loc10_28.6: i32 = bind_value %.loc10_28.5 // CHECK:STDOUT: %.loc10_28.7: (i32, i32, i32) = tuple_value (%.loc10_28.2, %.loc10_28.4, %.loc10_28.6) // CHECK:STDOUT: %.loc10_28.8: (i32, i32, i32) = converted %v.ref, %.loc10_28.7 diff --git a/toolchain/check/testdata/operators/assignment.carbon b/toolchain/check/testdata/operators/assignment.carbon index 8e3978298ded..4171bfa81c96 100644 --- a/toolchain/check/testdata/operators/assignment.carbon +++ b/toolchain/check/testdata/operators/assignment.carbon @@ -51,9 +51,9 @@ fn Main() { // CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 // CHECK:STDOUT: %.loc11_27: i32 = int_literal 2 // CHECK:STDOUT: %.loc11_28.1: (i32, i32) = tuple_literal (%.loc11_24, %.loc11_27) -// CHECK:STDOUT: %.loc11_28.2: ref i32 = tuple_access %b.var, member0 +// CHECK:STDOUT: %.loc11_28.2: ref i32 = tuple_access %b.var, element0 // CHECK:STDOUT: %.loc11_28.3: init i32 = initialize_from %.loc11_24 to %.loc11_28.2 -// CHECK:STDOUT: %.loc11_28.4: ref i32 = tuple_access %b.var, member1 +// CHECK:STDOUT: %.loc11_28.4: ref i32 = tuple_access %b.var, element1 // CHECK:STDOUT: %.loc11_28.5: init i32 = initialize_from %.loc11_27 to %.loc11_28.4 // CHECK:STDOUT: %.loc11_28.6: init (i32, i32) = tuple_init (%.loc11_28.3, %.loc11_28.5) to %b.var // CHECK:STDOUT: %.loc11_28.7: init (i32, i32) = converted %.loc11_28.1, %.loc11_28.6 @@ -74,19 +74,19 @@ fn Main() { // CHECK:STDOUT: %.loc15_37: i32 = int_literal 1 // CHECK:STDOUT: %.loc15_45: i32 = int_literal 2 // CHECK:STDOUT: %.loc15_46.1: {.a: i32, .b: i32} = struct_literal (%.loc15_37, %.loc15_45) -// CHECK:STDOUT: %.loc15_46.2: ref i32 = struct_access %c.var, member0 +// CHECK:STDOUT: %.loc15_46.2: ref i32 = struct_access %c.var, element0 // CHECK:STDOUT: %.loc15_46.3: init i32 = initialize_from %.loc15_37 to %.loc15_46.2 -// CHECK:STDOUT: %.loc15_46.4: ref i32 = struct_access %c.var, member1 +// CHECK:STDOUT: %.loc15_46.4: ref i32 = struct_access %c.var, element1 // CHECK:STDOUT: %.loc15_46.5: init i32 = initialize_from %.loc15_45 to %.loc15_46.4 // CHECK:STDOUT: %.loc15_46.6: init {.a: i32, .b: i32} = struct_init (%.loc15_46.3, %.loc15_46.5) to %c.var // CHECK:STDOUT: %.loc15_46.7: init {.a: i32, .b: i32} = converted %.loc15_46.1, %.loc15_46.6 // CHECK:STDOUT: assign %c.var, %.loc15_46.7 // CHECK:STDOUT: %c.ref.loc16: ref {.a: i32, .b: i32} = name_ref c, %c -// CHECK:STDOUT: %.loc16_4: ref i32 = struct_access %c.ref.loc16, member0 +// CHECK:STDOUT: %.loc16_4: ref i32 = struct_access %c.ref.loc16, element0 // CHECK:STDOUT: %.loc16_9: i32 = int_literal 3 // CHECK:STDOUT: assign %.loc16_4, %.loc16_9 // CHECK:STDOUT: %c.ref.loc17: ref {.a: i32, .b: i32} = name_ref c, %c -// CHECK:STDOUT: %.loc17_4: ref i32 = struct_access %c.ref.loc17, member1 +// CHECK:STDOUT: %.loc17_4: ref i32 = struct_access %c.ref.loc17, element1 // CHECK:STDOUT: %.loc17_9: i32 = int_literal 4 // CHECK:STDOUT: assign %.loc17_4, %.loc17_9 // CHECK:STDOUT: %.loc19_13: type = ptr_type i32 diff --git a/toolchain/check/testdata/operators/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/fail_assignment_to_non_assignable.carbon index 7dc1cf0e6110..ffc5345f7830 100644 --- a/toolchain/check/testdata/operators/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/fail_assignment_to_non_assignable.carbon @@ -76,9 +76,9 @@ fn Main() { // CHECK:STDOUT: %.loc21_13: i32 = int_literal 3 // CHECK:STDOUT: %.loc21_16: i32 = int_literal 4 // CHECK:STDOUT: %.loc21_17.1: (i32, i32) = tuple_literal (%.loc21_13, %.loc21_16) -// CHECK:STDOUT: %.loc21_17.2: i32 = tuple_access %.loc21_8.1, member0 +// CHECK:STDOUT: %.loc21_17.2: i32 = tuple_access %.loc21_8.1, element0 // CHECK:STDOUT: %.loc21_17.3: init i32 = initialize_from %.loc21_13 to %.loc21_17.2 -// CHECK:STDOUT: %.loc21_17.4: i32 = tuple_access %.loc21_8.1, member1 +// CHECK:STDOUT: %.loc21_17.4: i32 = tuple_access %.loc21_8.1, element1 // CHECK:STDOUT: %.loc21_17.5: init i32 = initialize_from %.loc21_16 to %.loc21_17.4 // CHECK:STDOUT: %.loc21_17.6: init (i32, i32) = tuple_init (%.loc21_17.3, %.loc21_17.5) to %.loc21_8.1 // CHECK:STDOUT: %.loc21_17.7: init (i32, i32) = converted %.loc21_17.1, %.loc21_17.6 @@ -95,9 +95,9 @@ fn Main() { // CHECK:STDOUT: %.loc26_13: i32 = int_literal 1 // CHECK:STDOUT: %.loc26_16: i32 = int_literal 2 // CHECK:STDOUT: %.loc26_17.1: (i32, i32) = tuple_literal (%.loc26_13, %.loc26_16) -// CHECK:STDOUT: %.loc26_17.2: i32 = tuple_access %.loc26_8.1, member0 +// CHECK:STDOUT: %.loc26_17.2: i32 = tuple_access %.loc26_8.1, element0 // CHECK:STDOUT: %.loc26_17.3: init i32 = initialize_from %.loc26_13 to %.loc26_17.2 -// CHECK:STDOUT: %.loc26_17.4: i32 = tuple_access %.loc26_8.1, member1 +// CHECK:STDOUT: %.loc26_17.4: i32 = tuple_access %.loc26_8.1, element1 // CHECK:STDOUT: %.loc26_17.5: init i32 = initialize_from %.loc26_16 to %.loc26_17.4 // CHECK:STDOUT: %.loc26_17.6: init (i32, i32) = tuple_init (%.loc26_17.3, %.loc26_17.5) to %.loc26_8.1 // CHECK:STDOUT: %.loc26_17.7: init (i32, i32) = converted %.loc26_17.1, %.loc26_17.6 @@ -114,9 +114,9 @@ fn Main() { // CHECK:STDOUT: %.loc34_28: i32 = int_literal 3 // CHECK:STDOUT: %.loc34_36: i32 = int_literal 4 // CHECK:STDOUT: %.loc34_37.1: {.x: i32, .y: i32} = struct_literal (%.loc34_28, %.loc34_36) -// CHECK:STDOUT: %.loc34_37.2: i32 = struct_access %.loc34_18.1, member0 +// CHECK:STDOUT: %.loc34_37.2: i32 = struct_access %.loc34_18.1, element0 // CHECK:STDOUT: %.loc34_37.3: init i32 = initialize_from %.loc34_28 to %.loc34_37.2 -// CHECK:STDOUT: %.loc34_37.4: i32 = struct_access %.loc34_18.1, member1 +// CHECK:STDOUT: %.loc34_37.4: i32 = struct_access %.loc34_18.1, element1 // CHECK:STDOUT: %.loc34_37.5: init i32 = initialize_from %.loc34_36 to %.loc34_37.4 // CHECK:STDOUT: %.loc34_37.6: init {.x: i32, .y: i32} = struct_init (%.loc34_37.3, %.loc34_37.5) to %.loc34_18.1 // CHECK:STDOUT: %.loc34_37.7: init {.x: i32, .y: i32} = converted %.loc34_37.1, %.loc34_37.6 diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 7da8c2b72dcf..ab3dd9e2babb 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -37,9 +37,9 @@ fn F() { // CHECK:STDOUT: %.loc8_37: i32 = int_literal 1 // CHECK:STDOUT: %.loc8_45: i32 = int_literal 2 // CHECK:STDOUT: %.loc8_46.1: {.a: i32, .b: i32} = struct_literal (%.loc8_37, %.loc8_45) -// CHECK:STDOUT: %.loc8_46.2: ref i32 = struct_access %s.var, member0 +// CHECK:STDOUT: %.loc8_46.2: ref i32 = struct_access %s.var, element0 // CHECK:STDOUT: %.loc8_46.3: init i32 = initialize_from %.loc8_37 to %.loc8_46.2 -// CHECK:STDOUT: %.loc8_46.4: ref i32 = struct_access %s.var, member1 +// CHECK:STDOUT: %.loc8_46.4: ref i32 = struct_access %s.var, element1 // CHECK:STDOUT: %.loc8_46.5: init i32 = initialize_from %.loc8_45 to %.loc8_46.4 // CHECK:STDOUT: %.loc8_46.6: init {.a: i32, .b: i32} = struct_init (%.loc8_46.3, %.loc8_46.5) to %s.var // CHECK:STDOUT: %.loc8_46.7: init {.a: i32, .b: i32} = converted %.loc8_46.1, %.loc8_46.6 @@ -55,14 +55,14 @@ fn F() { // CHECK:STDOUT: %q.var: ref i32* = var q // CHECK:STDOUT: %q: ref i32* = bind_name q, %q.var // CHECK:STDOUT: %s.ref.loc11: ref {.a: i32, .b: i32} = name_ref s, %s -// CHECK:STDOUT: %.loc11_19: ref i32 = struct_access %s.ref.loc11, member0 +// CHECK:STDOUT: %.loc11_19: ref i32 = struct_access %s.ref.loc11, element0 // CHECK:STDOUT: %.loc11_17: i32* = address_of %.loc11_19 // CHECK:STDOUT: assign %q.var, %.loc11_17 // CHECK:STDOUT: %.loc12_13: type = ptr_type i32 // CHECK:STDOUT: %r.var: ref i32* = var r // CHECK:STDOUT: %r: ref i32* = bind_name r, %r.var // CHECK:STDOUT: %s.ref.loc12: ref {.a: i32, .b: i32} = name_ref s, %s -// CHECK:STDOUT: %.loc12_19: ref i32 = struct_access %s.ref.loc12, member1 +// CHECK:STDOUT: %.loc12_19: ref i32 = struct_access %s.ref.loc12, element1 // CHECK:STDOUT: %.loc12_17: i32* = address_of %.loc12_19 // CHECK:STDOUT: assign %r.var, %.loc12_17 // CHECK:STDOUT: %.loc14_19.1: (type, type) = tuple_literal (i32, i32) @@ -72,9 +72,9 @@ fn F() { // CHECK:STDOUT: %.loc14_24: i32 = int_literal 1 // CHECK:STDOUT: %.loc14_27: i32 = int_literal 2 // CHECK:STDOUT: %.loc14_28.1: (i32, i32) = tuple_literal (%.loc14_24, %.loc14_27) -// CHECK:STDOUT: %.loc14_28.2: ref i32 = tuple_access %t.var, member0 +// CHECK:STDOUT: %.loc14_28.2: ref i32 = tuple_access %t.var, element0 // CHECK:STDOUT: %.loc14_28.3: init i32 = initialize_from %.loc14_24 to %.loc14_28.2 -// CHECK:STDOUT: %.loc14_28.4: ref i32 = tuple_access %t.var, member1 +// CHECK:STDOUT: %.loc14_28.4: ref i32 = tuple_access %t.var, element1 // CHECK:STDOUT: %.loc14_28.5: init i32 = initialize_from %.loc14_27 to %.loc14_28.4 // CHECK:STDOUT: %.loc14_28.6: init (i32, i32) = tuple_init (%.loc14_28.3, %.loc14_28.5) to %t.var // CHECK:STDOUT: %.loc14_28.7: init (i32, i32) = converted %.loc14_28.1, %.loc14_28.6 diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index 8c74dbd3a036..ff0e51c63f03 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -140,7 +140,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %.loc46_5.1: init {.a: i32} = call %H.ref() // CHECK:STDOUT: %.loc46_5.2: ref {.a: i32} = temporary_storage // CHECK:STDOUT: %.loc46_5.3: ref {.a: i32} = temporary %.loc46_5.2, %.loc46_5.1 -// CHECK:STDOUT: %.loc46_7: ref i32 = struct_access %.loc46_5.3, member0 +// CHECK:STDOUT: %.loc46_7: ref i32 = struct_access %.loc46_5.3, element0 // CHECK:STDOUT: %.loc46_3: i32* = address_of %.loc46_7 // CHECK:STDOUT: %.loc50_9: bool = bool_literal true // CHECK:STDOUT: %.loc50_5: bool = not %.loc50_9 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 52785e966ea0..1760d1af0ef9 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -42,11 +42,11 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc18_16.1: type = unbound_field_type C, i32 -// CHECK:STDOUT: %.loc18_16.2: = field a, member0 +// CHECK:STDOUT: %.loc18_16.1: type = unbound_element_type C, i32 +// CHECK:STDOUT: %.loc18_16.2: = field a, element0 // CHECK:STDOUT: %a: = bind_name a, %.loc18_16.2 -// CHECK:STDOUT: %.loc18_28.1: type = unbound_field_type C, i32 -// CHECK:STDOUT: %.loc18_28.2: = field b, member1 +// CHECK:STDOUT: %.loc18_28.1: type = unbound_element_type C, i32 +// CHECK:STDOUT: %.loc18_28.2: = field b, element1 // CHECK:STDOUT: %b: = bind_name b, %.loc18_28.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -71,9 +71,9 @@ fn G() -> C { // CHECK:STDOUT: %.loc20_29: i32 = int_literal 1 // CHECK:STDOUT: %.loc20_37: i32 = int_literal 2 // CHECK:STDOUT: %.loc20_38.1: {.a: i32, .b: i32} = struct_literal (%.loc20_29, %.loc20_37) -// CHECK:STDOUT: %.loc20_38.2: ref i32 = class_field_access %return, member0 +// CHECK:STDOUT: %.loc20_38.2: ref i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc20_38.3: init i32 = initialize_from %.loc20_29 to %.loc20_38.2 -// CHECK:STDOUT: %.loc20_38.4: ref i32 = class_field_access %return, member1 +// CHECK:STDOUT: %.loc20_38.4: ref i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc20_38.5: init i32 = initialize_from %.loc20_37 to %.loc20_38.4 // CHECK:STDOUT: %.loc20_38.6: init C = class_init (%.loc20_38.3, %.loc20_38.5), %return // CHECK:STDOUT: %.loc20_38.7: init C = converted %.loc20_38.1, %.loc20_38.6 diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 6c1e3cc60609..95c2ebc252d9 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -34,11 +34,11 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type C, i32 -// CHECK:STDOUT: %.loc8_8.2: = field a, member0 +// CHECK:STDOUT: %.loc8_8.1: type = unbound_element_type C, i32 +// CHECK:STDOUT: %.loc8_8.2: = field a, element0 // CHECK:STDOUT: %a: = bind_name a, %.loc8_8.2 -// CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type C, i32 -// CHECK:STDOUT: %.loc9_8.2: = field b, member1 +// CHECK:STDOUT: %.loc9_8.1: type = unbound_element_type C, i32 +// CHECK:STDOUT: %.loc9_8.2: = field b, element1 // CHECK:STDOUT: %b: = bind_name b, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -53,9 +53,9 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc13_34: i32 = int_literal 1 // CHECK:STDOUT: %.loc13_42: i32 = int_literal 2 // CHECK:STDOUT: %.loc13_43.1: {.a: i32, .b: i32} = struct_literal (%.loc13_34, %.loc13_42) -// CHECK:STDOUT: %.loc13_43.2: ref i32 = class_field_access %return, member0 +// CHECK:STDOUT: %.loc13_43.2: ref i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc13_43.3: init i32 = initialize_from %.loc13_34 to %.loc13_43.2 -// CHECK:STDOUT: %.loc13_43.4: ref i32 = class_field_access %return, member1 +// CHECK:STDOUT: %.loc13_43.4: ref i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc13_43.5: init i32 = initialize_from %.loc13_42 to %.loc13_43.4 // CHECK:STDOUT: %.loc13_43.6: init C = class_init (%.loc13_43.3, %.loc13_43.5), %return // CHECK:STDOUT: %.loc13_43.7: init C = converted %.loc13_43.1, %.loc13_43.6 diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index 05bbca23eb6a..085afa2b0c78 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -26,9 +26,9 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %.loc9_11: i32 = int_literal 15 // CHECK:STDOUT: %.loc9_15: i32 = int_literal 35 // CHECK:STDOUT: %.loc9_17.1: (i32, i32) = tuple_literal (%.loc9_11, %.loc9_15) -// CHECK:STDOUT: %.loc9_17.2: ref i32 = tuple_access %return, member0 +// CHECK:STDOUT: %.loc9_17.2: ref i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc9_17.3: init i32 = initialize_from %.loc9_11 to %.loc9_17.2 -// CHECK:STDOUT: %.loc9_17.4: ref i32 = tuple_access %return, member1 +// CHECK:STDOUT: %.loc9_17.4: ref i32 = tuple_access %return, element1 // CHECK:STDOUT: %.loc9_17.5: init i32 = initialize_from %.loc9_15 to %.loc9_17.4 // CHECK:STDOUT: %.loc9_17.6: init (i32, i32) = tuple_init (%.loc9_17.3, %.loc9_17.5) to %return // CHECK:STDOUT: %.loc9_17.7: init (i32, i32) = converted %.loc9_17.1, %.loc9_17.6 diff --git a/toolchain/check/testdata/struct/literal_member_access.carbon b/toolchain/check/testdata/struct/literal_member_access.carbon index 26c512d213d6..98db99264040 100644 --- a/toolchain/check/testdata/struct/literal_member_access.carbon +++ b/toolchain/check/testdata/struct/literal_member_access.carbon @@ -35,18 +35,18 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc10_34: i32 = int_literal 3 // CHECK:STDOUT: %.loc10_35.1: {.a: i32, .b: {.x: i32, .y: i32, .z: i32}, .c: i32} = struct_literal (%.loc10_16, %.loc10_25.2, %.loc10_34) // CHECK:STDOUT: %.loc10_25.3: ref {.x: i32, .y: i32, .z: i32} = temporary %.loc10_25.1, %.loc10_25.2 -// CHECK:STDOUT: %.loc10_25.4: ref i32 = struct_access %.loc10_25.3, member0 +// CHECK:STDOUT: %.loc10_25.4: ref i32 = struct_access %.loc10_25.3, element0 // CHECK:STDOUT: %.loc10_25.5: i32 = bind_value %.loc10_25.4 -// CHECK:STDOUT: %.loc10_25.6: ref i32 = struct_access %.loc10_25.3, member1 +// CHECK:STDOUT: %.loc10_25.6: ref i32 = struct_access %.loc10_25.3, element1 // CHECK:STDOUT: %.loc10_25.7: i32 = bind_value %.loc10_25.6 -// CHECK:STDOUT: %.loc10_25.8: ref i32 = struct_access %.loc10_25.3, member2 +// CHECK:STDOUT: %.loc10_25.8: ref i32 = struct_access %.loc10_25.3, element2 // CHECK:STDOUT: %.loc10_25.9: i32 = bind_value %.loc10_25.8 // CHECK:STDOUT: %.loc10_25.10: {.x: i32, .y: i32, .z: i32} = struct_value (%.loc10_25.5, %.loc10_25.7, %.loc10_25.9) // CHECK:STDOUT: %.loc10_25.11: {.x: i32, .y: i32, .z: i32} = converted %.loc10_25.2, %.loc10_25.10 // CHECK:STDOUT: %.loc10_35.2: {.a: i32, .b: {.x: i32, .y: i32, .z: i32}, .c: i32} = struct_value (%.loc10_16, %.loc10_25.11, %.loc10_34) // CHECK:STDOUT: %.loc10_35.3: {.a: i32, .b: {.x: i32, .y: i32, .z: i32}, .c: i32} = converted %.loc10_35.1, %.loc10_35.2 -// CHECK:STDOUT: %.loc10_36: {.x: i32, .y: i32, .z: i32} = struct_access %.loc10_35.3, member1 -// CHECK:STDOUT: %.loc10_38: i32 = struct_access %.loc10_36, member1 +// CHECK:STDOUT: %.loc10_36: {.x: i32, .y: i32, .z: i32} = struct_access %.loc10_35.3, element1 +// CHECK:STDOUT: %.loc10_38: i32 = struct_access %.loc10_36, element1 // CHECK:STDOUT: return %.loc10_38 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 41097437278c..1769584707f0 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -21,9 +21,9 @@ var z: i32 = y; // CHECK:STDOUT: %.loc7_35: f64 = real_literal 0e-1 // CHECK:STDOUT: %.loc7_45: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_46.1: {.a: f64, .b: i32} = struct_literal (%.loc7_35, %.loc7_45) -// CHECK:STDOUT: %.loc7_46.2: ref f64 = struct_access %x.var, member0 +// CHECK:STDOUT: %.loc7_46.2: ref f64 = struct_access %x.var, element0 // CHECK:STDOUT: %.loc7_46.3: init f64 = initialize_from %.loc7_35 to %.loc7_46.2 -// CHECK:STDOUT: %.loc7_46.4: ref i32 = struct_access %x.var, member1 +// CHECK:STDOUT: %.loc7_46.4: ref i32 = struct_access %x.var, element1 // CHECK:STDOUT: %.loc7_46.5: init i32 = initialize_from %.loc7_45 to %.loc7_46.4 // CHECK:STDOUT: %.loc7_46.6: init {.a: f64, .b: i32} = struct_init (%.loc7_46.3, %.loc7_46.5) to %x.var // CHECK:STDOUT: %.loc7_46.7: init {.a: f64, .b: i32} = converted %.loc7_46.1, %.loc7_46.6 @@ -31,7 +31,7 @@ var z: i32 = y; // CHECK:STDOUT: %y.var: ref i32 = var y // CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var // CHECK:STDOUT: %x.ref: ref {.a: f64, .b: i32} = name_ref x, %x -// CHECK:STDOUT: %.loc8_15.1: ref i32 = struct_access %x.ref, member1 +// CHECK:STDOUT: %.loc8_15.1: ref i32 = struct_access %x.ref, element1 // CHECK:STDOUT: %.loc8_15.2: i32 = bind_value %.loc8_15.1 // CHECK:STDOUT: assign %y.var, %.loc8_15.2 // CHECK:STDOUT: %z.var: ref i32 = var z diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index cfee9a5d1653..f05cdc556d09 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -37,10 +37,10 @@ fn G() { // CHECK:STDOUT: %v.var: ref {.a: (i32, i32, i32), .b: (i32, i32, i32)} = var v // CHECK:STDOUT: %v: ref {.a: (i32, i32, i32), .b: (i32, i32, i32)} = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc10_61: = name_ref F, file.%F -// CHECK:STDOUT: %.loc10_74.1: ref (i32, i32, i32) = struct_access %v.var, member0 +// CHECK:STDOUT: %.loc10_74.1: ref (i32, i32, i32) = struct_access %v.var, element0 // CHECK:STDOUT: %.loc10_62: init (i32, i32, i32) = call %F.ref.loc10_61() to %.loc10_74.1 // CHECK:STDOUT: %F.ref.loc10_71: = name_ref F, file.%F -// CHECK:STDOUT: %.loc10_74.2: ref (i32, i32, i32) = struct_access %v.var, member1 +// CHECK:STDOUT: %.loc10_74.2: ref (i32, i32, i32) = struct_access %v.var, element1 // CHECK:STDOUT: %.loc10_72: init (i32, i32, i32) = call %F.ref.loc10_71() to %.loc10_74.2 // CHECK:STDOUT: %.loc10_74.3: {.a: (i32, i32, i32), .b: (i32, i32, i32)} = struct_literal (%.loc10_62, %.loc10_72) // CHECK:STDOUT: %.loc10_74.4: init {.a: (i32, i32, i32), .b: (i32, i32, i32)} = struct_init (%.loc10_62, %.loc10_72) to %v.var diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index 9cb34447ecdb..ace7a6ff7627 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -22,7 +22,7 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %y.var: ref {.a: i32} = var y // CHECK:STDOUT: %y: ref {.a: i32} = bind_name y, %y.var // CHECK:STDOUT: %x.ref: ref {.a: i32} = name_ref x, %x -// CHECK:STDOUT: %.loc8_20.1: ref i32 = struct_access %x.ref, member0 +// CHECK:STDOUT: %.loc8_20.1: ref i32 = struct_access %x.ref, element0 // CHECK:STDOUT: %.loc8_20.2: i32 = bind_value %.loc8_20.1 // CHECK:STDOUT: %.loc8_20.3: init {.a: i32} = struct_init (%.loc8_20.2) to %y.var // CHECK:STDOUT: %.loc8_20.4: init {.a: i32} = converted %x.ref, %.loc8_20.3 diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index ed0809fab1e5..17b2db9b2a64 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -48,17 +48,17 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %x: {.a: i32, .b: f64} = bind_name x, %.loc11_62.7 // CHECK:STDOUT: %.loc12_27: type = struct_type {.b: f64, .a: i32} // CHECK:STDOUT: %x.ref: {.a: i32, .b: f64} = name_ref x, %x -// CHECK:STDOUT: %.loc12_31.1: f64 = struct_access %x.ref, member1 -// CHECK:STDOUT: %.loc12_31.2: i32 = struct_access %x.ref, member0 +// CHECK:STDOUT: %.loc12_31.1: f64 = struct_access %x.ref, element1 +// CHECK:STDOUT: %.loc12_31.2: i32 = struct_access %x.ref, element0 // CHECK:STDOUT: %.loc12_31.3: {.b: f64, .a: i32} = struct_value (%.loc12_31.1, %.loc12_31.2) // CHECK:STDOUT: %.loc12_31.4: {.b: f64, .a: i32} = converted %x.ref, %.loc12_31.3 // CHECK:STDOUT: %y: {.b: f64, .a: i32} = bind_name y, %.loc12_31.4 // CHECK:STDOUT: %y.ref: {.b: f64, .a: i32} = name_ref y, %y -// CHECK:STDOUT: %.loc13_10.1: i32 = struct_access %y.ref, member1 -// CHECK:STDOUT: %.loc13_10.2: ref i32 = struct_access %return, member1 +// CHECK:STDOUT: %.loc13_10.1: i32 = struct_access %y.ref, element1 +// CHECK:STDOUT: %.loc13_10.2: ref i32 = struct_access %return, element1 // CHECK:STDOUT: %.loc13_10.3: init i32 = initialize_from %.loc13_10.1 to %.loc13_10.2 -// CHECK:STDOUT: %.loc13_10.4: f64 = struct_access %y.ref, member0 -// CHECK:STDOUT: %.loc13_10.5: ref f64 = struct_access %return, member0 +// CHECK:STDOUT: %.loc13_10.4: f64 = struct_access %y.ref, element0 +// CHECK:STDOUT: %.loc13_10.5: ref f64 = struct_access %return, element0 // CHECK:STDOUT: %.loc13_10.6: init f64 = initialize_from %.loc13_10.4 to %.loc13_10.5 // CHECK:STDOUT: %.loc13_10.7: init {.a: i32, .b: f64} = struct_init (%.loc13_10.3, %.loc13_10.6) to %return // CHECK:STDOUT: %.loc13_10.8: init {.a: i32, .b: f64} = converted %y.ref, %.loc13_10.7 diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index 4e9ee478f385..549d2b14a85f 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -25,9 +25,9 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %.loc7_47: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_49.1: (i32,) = tuple_literal (%.loc7_47) // CHECK:STDOUT: %.loc7_50.1: {.a: i32, .b: (i32,)} = struct_literal (%.loc7_38, %.loc7_49.1) -// CHECK:STDOUT: %.loc7_50.2: ref i32 = struct_access %x.var, member0 +// CHECK:STDOUT: %.loc7_50.2: ref i32 = struct_access %x.var, element0 // CHECK:STDOUT: %.loc7_50.3: init i32 = initialize_from %.loc7_38 to %.loc7_50.2 -// CHECK:STDOUT: %.loc7_50.4: ref (i32,) = struct_access %x.var, member1 +// CHECK:STDOUT: %.loc7_50.4: ref (i32,) = struct_access %x.var, element1 // CHECK:STDOUT: %.loc7_49.2: init (i32,) = tuple_init (%.loc7_47) to %.loc7_50.4 // CHECK:STDOUT: %.loc7_49.3: init (i32,) = converted %.loc7_49.1, %.loc7_49.2 // CHECK:STDOUT: %.loc7_50.5: init (i32,) = initialize_from %.loc7_49.3 to %.loc7_50.4 @@ -40,14 +40,14 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %y.var: ref {.a: i32, .b: (i32,)} = var y // CHECK:STDOUT: %y: ref {.a: i32, .b: (i32,)} = bind_name y, %y.var // CHECK:STDOUT: %x.ref: ref {.a: i32, .b: (i32,)} = name_ref x, %x -// CHECK:STDOUT: %.loc8_32.1: ref i32 = struct_access %x.ref, member0 +// CHECK:STDOUT: %.loc8_32.1: ref i32 = struct_access %x.ref, element0 // CHECK:STDOUT: %.loc8_32.2: i32 = bind_value %.loc8_32.1 -// CHECK:STDOUT: %.loc8_32.3: ref i32 = struct_access %y.var, member0 +// CHECK:STDOUT: %.loc8_32.3: ref i32 = struct_access %y.var, element0 // CHECK:STDOUT: %.loc8_32.4: init i32 = initialize_from %.loc8_32.2 to %.loc8_32.3 -// CHECK:STDOUT: %.loc8_32.5: ref (i32,) = struct_access %x.ref, member1 -// CHECK:STDOUT: %.loc8_32.6: ref i32 = tuple_access %.loc8_32.5, member0 +// CHECK:STDOUT: %.loc8_32.5: ref (i32,) = struct_access %x.ref, element1 +// CHECK:STDOUT: %.loc8_32.6: ref i32 = tuple_access %.loc8_32.5, element0 // CHECK:STDOUT: %.loc8_32.7: i32 = bind_value %.loc8_32.6 -// CHECK:STDOUT: %.loc8_32.8: ref (i32,) = struct_access %y.var, member1 +// CHECK:STDOUT: %.loc8_32.8: ref (i32,) = struct_access %y.var, element1 // CHECK:STDOUT: %.loc8_32.9: init (i32,) = tuple_init (%.loc8_32.7) to %.loc8_32.8 // CHECK:STDOUT: %.loc8_32.10: init (i32,) = converted %.loc8_32.5, %.loc8_32.9 // CHECK:STDOUT: %.loc8_32.11: init (i32,) = initialize_from %.loc8_32.10 to %.loc8_32.8 diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index f51679b6c88f..b19032d607eb 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -20,9 +20,9 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %.loc7_35: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_43: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_44.1: {.a: i32, .b: i32} = struct_literal (%.loc7_35, %.loc7_43) -// CHECK:STDOUT: %.loc7_44.2: ref i32 = struct_access %x.var, member0 +// CHECK:STDOUT: %.loc7_44.2: ref i32 = struct_access %x.var, element0 // CHECK:STDOUT: %.loc7_44.3: init i32 = initialize_from %.loc7_35 to %.loc7_44.2 -// CHECK:STDOUT: %.loc7_44.4: ref i32 = struct_access %x.var, member1 +// CHECK:STDOUT: %.loc7_44.4: ref i32 = struct_access %x.var, element1 // CHECK:STDOUT: %.loc7_44.5: init i32 = initialize_from %.loc7_43 to %.loc7_44.4 // CHECK:STDOUT: %.loc7_44.6: init {.a: i32, .b: i32} = struct_init (%.loc7_44.3, %.loc7_44.5) to %x.var // CHECK:STDOUT: %.loc7_44.7: init {.a: i32, .b: i32} = converted %.loc7_44.1, %.loc7_44.6 @@ -31,13 +31,13 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %y.var: ref {.a: i32, .b: i32} = var y // CHECK:STDOUT: %y: ref {.a: i32, .b: i32} = bind_name y, %y.var // CHECK:STDOUT: %x.ref: ref {.a: i32, .b: i32} = name_ref x, %x -// CHECK:STDOUT: %.loc8_29.1: ref i32 = struct_access %x.ref, member0 +// CHECK:STDOUT: %.loc8_29.1: ref i32 = struct_access %x.ref, element0 // CHECK:STDOUT: %.loc8_29.2: i32 = bind_value %.loc8_29.1 -// CHECK:STDOUT: %.loc8_29.3: ref i32 = struct_access %y.var, member0 +// CHECK:STDOUT: %.loc8_29.3: ref i32 = struct_access %y.var, element0 // CHECK:STDOUT: %.loc8_29.4: init i32 = initialize_from %.loc8_29.2 to %.loc8_29.3 -// CHECK:STDOUT: %.loc8_29.5: ref i32 = struct_access %x.ref, member1 +// CHECK:STDOUT: %.loc8_29.5: ref i32 = struct_access %x.ref, element1 // CHECK:STDOUT: %.loc8_29.6: i32 = bind_value %.loc8_29.5 -// CHECK:STDOUT: %.loc8_29.7: ref i32 = struct_access %y.var, member1 +// CHECK:STDOUT: %.loc8_29.7: ref i32 = struct_access %y.var, element1 // CHECK:STDOUT: %.loc8_29.8: init i32 = initialize_from %.loc8_29.6 to %.loc8_29.7 // CHECK:STDOUT: %.loc8_29.9: init {.a: i32, .b: i32} = struct_init (%.loc8_29.4, %.loc8_29.8) to %y.var // CHECK:STDOUT: %.loc8_29.10: init {.a: i32, .b: i32} = converted %x.ref, %.loc8_29.9 diff --git a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon index 455f3cf17dc1..e031f0eb51a3 100644 --- a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon @@ -26,7 +26,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %.loc10_22: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_25: f64 = real_literal 6589e-2 // CHECK:STDOUT: %.loc10_30.1: (i32, f64) = tuple_literal (%.loc10_22, %.loc10_25) -// CHECK:STDOUT: %.loc10_30.2: ref i32 = tuple_access %x.var, member0 +// CHECK:STDOUT: %.loc10_30.2: ref i32 = tuple_access %x.var, element0 // CHECK:STDOUT: %.loc10_30.3: init i32 = initialize_from %.loc10_22 to %.loc10_30.2 // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/nested_tuple.carbon b/toolchain/check/testdata/tuples/nested_tuple.carbon index e50dc96db55f..42f63e2a7af3 100644 --- a/toolchain/check/testdata/tuples/nested_tuple.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple.carbon @@ -30,14 +30,14 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %.loc7_36.1: (i32, i32) = tuple_literal (%.loc7_30, %.loc7_34) // CHECK:STDOUT: %.loc7_39: i32 = int_literal 6 // CHECK:STDOUT: %.loc7_40.1: ((i32, i32), i32) = tuple_literal (%.loc7_36.1, %.loc7_39) -// CHECK:STDOUT: %.loc7_40.2: ref (i32, i32) = tuple_access %x.var, member0 -// CHECK:STDOUT: %.loc7_36.2: ref i32 = tuple_access %.loc7_40.2, member0 +// CHECK:STDOUT: %.loc7_40.2: ref (i32, i32) = tuple_access %x.var, element0 +// CHECK:STDOUT: %.loc7_36.2: ref i32 = tuple_access %.loc7_40.2, element0 // CHECK:STDOUT: %.loc7_36.3: init i32 = initialize_from %.loc7_30 to %.loc7_36.2 -// CHECK:STDOUT: %.loc7_36.4: ref i32 = tuple_access %.loc7_40.2, member1 +// CHECK:STDOUT: %.loc7_36.4: ref i32 = tuple_access %.loc7_40.2, element1 // CHECK:STDOUT: %.loc7_36.5: init i32 = initialize_from %.loc7_34 to %.loc7_36.4 // CHECK:STDOUT: %.loc7_36.6: init (i32, i32) = tuple_init (%.loc7_36.3, %.loc7_36.5) to %.loc7_40.2 // CHECK:STDOUT: %.loc7_36.7: init (i32, i32) = converted %.loc7_36.1, %.loc7_36.6 -// CHECK:STDOUT: %.loc7_40.3: ref i32 = tuple_access %x.var, member1 +// CHECK:STDOUT: %.loc7_40.3: ref i32 = tuple_access %x.var, element1 // CHECK:STDOUT: %.loc7_40.4: init i32 = initialize_from %.loc7_39 to %.loc7_40.3 // CHECK:STDOUT: %.loc7_40.5: init ((i32, i32), i32) = tuple_init (%.loc7_36.7, %.loc7_40.4) to %x.var // CHECK:STDOUT: %.loc7_40.6: init ((i32, i32), i32) = converted %.loc7_40.1, %.loc7_40.5 diff --git a/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon index b6709adb1eb2..231b98390446 100644 --- a/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon @@ -49,10 +49,10 @@ fn H() { // CHECK:STDOUT: %v.var: ref ((i32, i32, i32), (i32, i32, i32)) = var v // CHECK:STDOUT: %v: ref ((i32, i32, i32), (i32, i32, i32)) = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc10_48: = name_ref F, file.%F -// CHECK:STDOUT: %.loc10_56.1: ref (i32, i32, i32) = tuple_access %v.var, member0 +// CHECK:STDOUT: %.loc10_56.1: ref (i32, i32, i32) = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc10_49: init (i32, i32, i32) = call %F.ref.loc10_48() to %.loc10_56.1 // CHECK:STDOUT: %F.ref.loc10_53: = name_ref F, file.%F -// CHECK:STDOUT: %.loc10_56.2: ref (i32, i32, i32) = tuple_access %v.var, member1 +// CHECK:STDOUT: %.loc10_56.2: ref (i32, i32, i32) = tuple_access %v.var, element1 // CHECK:STDOUT: %.loc10_54: init (i32, i32, i32) = call %F.ref.loc10_53() to %.loc10_56.2 // CHECK:STDOUT: %.loc10_56.3: ((i32, i32, i32), (i32, i32, i32)) = tuple_literal (%.loc10_49, %.loc10_54) // CHECK:STDOUT: %.loc10_56.4: init ((i32, i32, i32), (i32, i32, i32)) = tuple_init (%.loc10_49, %.loc10_54) to %v.var @@ -71,13 +71,13 @@ fn H() { // CHECK:STDOUT: %v: ref (i32, (i32, i32, i32), i32) = bind_name v, %v.var // CHECK:STDOUT: %.loc14_41: i32 = int_literal 1 // CHECK:STDOUT: %F.ref: = name_ref F, file.%F -// CHECK:STDOUT: %.loc14_50.1: ref (i32, i32, i32) = tuple_access %v.var, member1 +// CHECK:STDOUT: %.loc14_50.1: ref (i32, i32, i32) = tuple_access %v.var, element1 // CHECK:STDOUT: %.loc14_45: init (i32, i32, i32) = call %F.ref() to %.loc14_50.1 // CHECK:STDOUT: %.loc14_49: i32 = int_literal 2 // CHECK:STDOUT: %.loc14_50.2: (i32, (i32, i32, i32), i32) = tuple_literal (%.loc14_41, %.loc14_45, %.loc14_49) -// CHECK:STDOUT: %.loc14_50.3: ref i32 = tuple_access %v.var, member0 +// CHECK:STDOUT: %.loc14_50.3: ref i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc14_50.4: init i32 = initialize_from %.loc14_41 to %.loc14_50.3 -// CHECK:STDOUT: %.loc14_50.5: ref i32 = tuple_access %v.var, member2 +// CHECK:STDOUT: %.loc14_50.5: ref i32 = tuple_access %v.var, element2 // CHECK:STDOUT: %.loc14_50.6: init i32 = initialize_from %.loc14_49 to %.loc14_50.5 // CHECK:STDOUT: %.loc14_50.7: init (i32, (i32, i32, i32), i32) = tuple_init (%.loc14_50.4, %.loc14_45, %.loc14_50.6) to %v.var // CHECK:STDOUT: %.loc14_50.8: init (i32, (i32, i32, i32), i32) = converted %.loc14_50.2, %.loc14_50.7 diff --git a/toolchain/check/testdata/tuples/one_element.carbon b/toolchain/check/testdata/tuples/one_element.carbon index ce2a9c7c597a..31ee2556519f 100644 --- a/toolchain/check/testdata/tuples/one_element.carbon +++ b/toolchain/check/testdata/tuples/one_element.carbon @@ -29,7 +29,7 @@ var y: (i32,) = x; // CHECK:STDOUT: %y.var: ref (i32,) = var y // CHECK:STDOUT: %y: ref (i32,) = bind_name y, %y.var // CHECK:STDOUT: %x.ref: ref (i32,) = name_ref x, %x -// CHECK:STDOUT: %.loc8_17.1: ref i32 = tuple_access %x.ref, member0 +// CHECK:STDOUT: %.loc8_17.1: ref i32 = tuple_access %x.ref, element0 // CHECK:STDOUT: %.loc8_17.2: i32 = bind_value %.loc8_17.1 // CHECK:STDOUT: %.loc8_17.3: init (i32,) = tuple_init (%.loc8_17.2) to %y.var // CHECK:STDOUT: %.loc8_17.4: init (i32,) = converted %x.ref, %.loc8_17.3 diff --git a/toolchain/check/testdata/tuples/two_elements.carbon b/toolchain/check/testdata/tuples/two_elements.carbon index cfcf00ed1bd5..e6309b08a287 100644 --- a/toolchain/check/testdata/tuples/two_elements.carbon +++ b/toolchain/check/testdata/tuples/two_elements.carbon @@ -23,9 +23,9 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %.loc7_22: i32 = int_literal 4 // CHECK:STDOUT: %.loc7_25: i32 = int_literal 102 // CHECK:STDOUT: %.loc7_28.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_25) -// CHECK:STDOUT: %.loc7_28.2: ref i32 = tuple_access %x.var, member0 +// CHECK:STDOUT: %.loc7_28.2: ref i32 = tuple_access %x.var, element0 // CHECK:STDOUT: %.loc7_28.3: init i32 = initialize_from %.loc7_22 to %.loc7_28.2 -// CHECK:STDOUT: %.loc7_28.4: ref i32 = tuple_access %x.var, member1 +// CHECK:STDOUT: %.loc7_28.4: ref i32 = tuple_access %x.var, element1 // CHECK:STDOUT: %.loc7_28.5: init i32 = initialize_from %.loc7_25 to %.loc7_28.4 // CHECK:STDOUT: %.loc7_28.6: init (i32, i32) = tuple_init (%.loc7_28.3, %.loc7_28.5) to %x.var // CHECK:STDOUT: %.loc7_28.7: init (i32, i32) = converted %.loc7_28.1, %.loc7_28.6 @@ -35,13 +35,13 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %y.var: ref (i32, i32) = var y // CHECK:STDOUT: %y: ref (i32, i32) = bind_name y, %y.var // CHECK:STDOUT: %x.ref: ref (i32, i32) = name_ref x, %x -// CHECK:STDOUT: %.loc8_21.1: ref i32 = tuple_access %x.ref, member0 +// CHECK:STDOUT: %.loc8_21.1: ref i32 = tuple_access %x.ref, element0 // CHECK:STDOUT: %.loc8_21.2: i32 = bind_value %.loc8_21.1 -// CHECK:STDOUT: %.loc8_21.3: ref i32 = tuple_access %y.var, member0 +// CHECK:STDOUT: %.loc8_21.3: ref i32 = tuple_access %y.var, element0 // CHECK:STDOUT: %.loc8_21.4: init i32 = initialize_from %.loc8_21.2 to %.loc8_21.3 -// CHECK:STDOUT: %.loc8_21.5: ref i32 = tuple_access %x.ref, member1 +// CHECK:STDOUT: %.loc8_21.5: ref i32 = tuple_access %x.ref, element1 // CHECK:STDOUT: %.loc8_21.6: i32 = bind_value %.loc8_21.5 -// CHECK:STDOUT: %.loc8_21.7: ref i32 = tuple_access %y.var, member1 +// CHECK:STDOUT: %.loc8_21.7: ref i32 = tuple_access %y.var, element1 // CHECK:STDOUT: %.loc8_21.8: init i32 = initialize_from %.loc8_21.6 to %.loc8_21.7 // CHECK:STDOUT: %.loc8_21.9: init (i32, i32) = tuple_init (%.loc8_21.4, %.loc8_21.8) to %y.var // CHECK:STDOUT: %.loc8_21.10: init (i32, i32) = converted %x.ref, %.loc8_21.9 diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 3786ab03c572..a7b8ef0959f1 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -299,7 +299,7 @@ auto FileContext::BuildType(SemIR::InstId inst_id) -> llvm::Type* { } return llvm::StructType::get(*llvm_context_, subtypes); } - case SemIR::UnboundFieldType::Kind: { + case SemIR::UnboundElementType::Kind: { // Return an empty struct as a placeholder. return llvm::StructType::get(*llvm_context_); } diff --git a/toolchain/lower/handle_aggregates.cpp b/toolchain/lower/handle_aggregates.cpp index 631f21666db7..85c97ea96d24 100644 --- a/toolchain/lower/handle_aggregates.cpp +++ b/toolchain/lower/handle_aggregates.cpp @@ -22,7 +22,7 @@ auto HandleClassDecl(FunctionContext& /*context*/, SemIR::InstId /*inst_id*/, // aggregate input, this will either produce a value or a reference. static auto GetAggregateElement(FunctionContext& context, SemIR::InstId aggr_inst_id, - SemIR::MemberIndex idx, + SemIR::ElementIndex idx, SemIR::TypeId result_type_id, llvm::Twine name) -> llvm::Value* { auto aggr_inst = context.sem_ir().insts().Get(aggr_inst_id); @@ -90,7 +90,7 @@ static auto GetAggregateElement(FunctionContext& context, static auto GetStructFieldName(FunctionContext& context, SemIR::TypeId struct_type_id, - SemIR::MemberIndex index) -> llvm::StringRef { + SemIR::ElementIndex index) -> llvm::StringRef { auto fields = context.sem_ir().inst_blocks().Get( context.sem_ir() .insts() @@ -102,8 +102,8 @@ static auto GetStructFieldName(FunctionContext& context, return context.sem_ir().names().GetIRBaseName(field.name_id); } -auto HandleClassFieldAccess(FunctionContext& context, SemIR::InstId inst_id, - SemIR::ClassFieldAccess inst) -> void { +auto HandleClassElementAccess(FunctionContext& context, SemIR::InstId inst_id, + SemIR::ClassElementAccess inst) -> void { // Find the class that we're performing access into. auto class_type_id = context.sem_ir().insts().Get(inst.base_id).type_id(); auto class_id = @@ -261,7 +261,7 @@ auto HandleTupleIndex(FunctionContext& context, SemIR::InstId inst_id, context.sem_ir().insts().GetAs(inst.index_id); auto index = context.sem_ir().ints().Get(index_inst.int_id).getZExtValue(); context.SetLocal(inst_id, GetAggregateElement(context, inst.tuple_id, - SemIR::MemberIndex(index), + SemIR::ElementIndex(index), inst.type_id, "tuple.index")); } diff --git a/toolchain/lower/handle_type.cpp b/toolchain/lower/handle_type.cpp index 5c028893f735..a1db0d78a6a7 100644 --- a/toolchain/lower/handle_type.cpp +++ b/toolchain/lower/handle_type.cpp @@ -36,8 +36,8 @@ auto HandleTupleType(FunctionContext& context, SemIR::InstId inst_id, context.SetLocal(inst_id, context.GetTypeAsValue()); } -auto HandleUnboundFieldType(FunctionContext& context, SemIR::InstId inst_id, - SemIR::UnboundFieldType /*inst*/) -> void { +auto HandleUnboundElementType(FunctionContext& context, SemIR::InstId inst_id, + SemIR::UnboundElementType /*inst*/) -> void { context.SetLocal(inst_id, context.GetTypeAsValue()); } diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index b0a74aa882ff..ecb4513929b0 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -170,7 +170,7 @@ static auto GetTypePrecedence(InstKind kind) -> int { case NameRef::Kind: case StructType::Kind: case TupleType::Kind: - case UnboundFieldType::Kind: + case UnboundElementType::Kind: return 0; case ConstType::Kind: return -1; @@ -198,7 +198,7 @@ static auto GetTypePrecedence(InstKind kind) -> int { case BranchWithArg::Kind: case Call::Kind: case ClassDecl::Kind: - case ClassFieldAccess::Kind: + case ClassElementAccess::Kind: case ClassInit::Kind: case Converted::Kind: case Deref::Kind: @@ -374,12 +374,12 @@ auto File::StringifyTypeExpr(InstId outer_inst_id, bool in_type_context) const {.inst_id = GetTypeAllowBuiltinTypes(refs[step.index])}); break; } - case UnboundFieldType::Kind: { + case UnboundElementType::Kind: { if (step.index == 0) { out << "().class_type_id)}); + inst.As().class_type_id)}); } else { out << ">"; } @@ -401,7 +401,7 @@ auto File::StringifyTypeExpr(InstId outer_inst_id, bool in_type_context) const case Builtin::Kind: case Call::Kind: case ClassDecl::Kind: - case ClassFieldAccess::Kind: + case ClassElementAccess::Kind: case ClassInit::Kind: case Converted::Kind: case CrossRef::Kind: @@ -521,7 +521,7 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case TupleValue::Kind: case TupleType::Kind: case UnaryOperatorNot::Kind: - case UnboundFieldType::Kind: + case UnboundElementType::Kind: case ValueOfInitializer::Kind: return value_category; @@ -542,8 +542,8 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { continue; } - case ClassFieldAccess::Kind: { - inst_id = inst.As().base_id; + case ClassElementAccess::Kind: { + inst_id = inst.As().base_id; // A value of class type is a pointer to an object representation. // Therefore, if the base is a value, the result is an ephemeral // reference. diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 563615e1d014..87aeffe15ea6 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -873,7 +873,7 @@ class Formatter { sem_ir_.ints().Get(id).print(out_, /*isSigned=*/false); } - auto FormatArg(MemberIndex index) -> void { out_ << index; } + auto FormatArg(ElementIndex index) -> void { out_ << index; } auto FormatArg(NameScopeId id) -> void { out_ << '{'; diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index b50657a4b14c..6d332966d31f 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -267,11 +267,11 @@ struct TypeBlockId : public IdBase, public Printable { } }; -// An index for member access, for structs and tuples. -struct MemberIndex : public IndexBase, public Printable { +// An index for element access, for structs, tuples, and classes. +struct ElementIndex : public IndexBase, public Printable { using IndexBase::IndexBase; auto Print(llvm::raw_ostream& out) const -> void { - out << "member"; + out << "element"; IndexBase::Print(out); } }; diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index f3f9f45c0ff5..8a5f5c0ae1ac 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -34,7 +34,7 @@ CARBON_SEM_IR_INST_KIND(BranchWithArg) CARBON_SEM_IR_INST_KIND(Builtin) CARBON_SEM_IR_INST_KIND(Call) CARBON_SEM_IR_INST_KIND(ClassDecl) -CARBON_SEM_IR_INST_KIND(ClassFieldAccess) +CARBON_SEM_IR_INST_KIND(ClassElementAccess) CARBON_SEM_IR_INST_KIND(ClassInit) CARBON_SEM_IR_INST_KIND(ClassType) CARBON_SEM_IR_INST_KIND(ConstType) @@ -72,7 +72,7 @@ CARBON_SEM_IR_INST_KIND(TupleLiteral) CARBON_SEM_IR_INST_KIND(TupleType) CARBON_SEM_IR_INST_KIND(TupleValue) CARBON_SEM_IR_INST_KIND(UnaryOperatorNot) -CARBON_SEM_IR_INST_KIND(UnboundFieldType) +CARBON_SEM_IR_INST_KIND(UnboundElementType) CARBON_SEM_IR_INST_KIND(ValueAsRef) CARBON_SEM_IR_INST_KIND(ValueOfInitializer) CARBON_SEM_IR_INST_KIND(VarStorage) diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index f01fec2f492e..a0d46026d2ca 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -206,14 +206,14 @@ struct ClassDecl { InstBlockId decl_block_id; }; -struct ClassFieldAccess { +struct ClassElementAccess { static constexpr auto Kind = - InstKind::ClassFieldAccess.Define("class_field_access"); + InstKind::ClassElementAccess.Define("class_element_access"); Parse::NodeId parse_node; TypeId type_id; InstId base_id; - MemberIndex index; + ElementIndex index; }; struct ClassInit { @@ -272,14 +272,14 @@ struct Deref { }; // A field in a class, of the form `var field: field_type;`. The type of the -// `Field` instruction is an `UnboundFieldType`. +// `Field` instruction is an `UnboundElementType`. struct Field { static constexpr auto Kind = InstKind::Field.Define("field"); Parse::NodeId parse_node; TypeId type_id; NameId name_id; - MemberIndex index; + ElementIndex index; }; struct FunctionDecl { @@ -421,7 +421,7 @@ struct StructAccess { Parse::NodeId parse_node; TypeId type_id; InstId struct_id; - MemberIndex index; + ElementIndex index; }; struct StructInit { @@ -492,7 +492,7 @@ struct TupleAccess { Parse::NodeId parse_node; TypeId type_id; InstId tuple_id; - MemberIndex index; + ElementIndex index; }; struct TupleIndex { @@ -545,19 +545,19 @@ struct UnaryOperatorNot { InstId operand_id; }; -// The type of an expression naming an unbound field, such as `Class.field`. -// This can be used as the operand of a compound member access expression, -// such as `instance.(Class.field)`. -struct UnboundFieldType { +// The type of an expression naming an unbound element of a class, such as +// `Class.field`. This can be used as the operand of a compound member access +// expression, such as `instance.(Class.field)`. +struct UnboundElementType { static constexpr auto Kind = - InstKind::UnboundFieldType.Define("unbound_field_type"); + InstKind::UnboundElementType.Define("unbound_element_type"); Parse::NodeId parse_node; TypeId type_id; - // The class of which the field is a member. + // The class that a value of this type is an element of. TypeId class_type_id; - // The type of the field. - TypeId field_type_id; + // The type of the element. + TypeId element_type_id; }; struct ValueAsRef {