Skip to content

Commit

Permalink
put-field-order-back
Browse files Browse the repository at this point in the history
  • Loading branch information
danakj committed Nov 29, 2024
1 parent 7058bae commit 71ca1d2
Show file tree
Hide file tree
Showing 65 changed files with 374 additions and 374 deletions.
4 changes: 2 additions & 2 deletions toolchain/check/import_ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1287,8 +1287,8 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver,
return ResolveAs<SemIR::AssociatedEntity>(
resolver, {.type_id = resolver.local_context().GetTypeIdForTypeConstant(
type_const_id),
.decl_id = decl_id,
.index = inst.index});
.index = inst.index,
.decl_id = decl_id});
}

static auto TryResolveTypedInst(ImportRefResolver& resolver,
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ auto BuildAssociatedEntity(Context& context, SemIR::InterfaceId interface_id,
self_type_id, context.insts().Get(decl_id).type_id());
return context.AddInst<SemIR::AssociatedEntity>(
context.insts().GetLocId(decl_id),
{.type_id = type_id, .decl_id = decl_id, .index = index});
{.type_id = type_id, .index = index, .decl_id = decl_id});
}

} // namespace Carbon::Check
34 changes: 17 additions & 17 deletions toolchain/check/testdata/class/generic/import.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
// CHECK:STDOUT: %.1: type = facet_access_type %Self.2 [symbolic]
// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
// CHECK:STDOUT: %.3: %.2 = assoc_entity imports.%import_ref.10, element0 [symbolic]
// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.10 [symbolic]
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic]
// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic]
// CHECK:STDOUT: %.4: <witness> = interface_witness (%Convert.2) [symbolic]
Expand All @@ -285,7 +285,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template]
// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template]
// CHECK:STDOUT: %.9: %.8 = assoc_entity imports.%import_ref.17, element0 [template]
// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.17 [template]
// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic]
// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic]
// CHECK:STDOUT: %.10: <witness> = interface_witness (%Convert.6) [symbolic]
Expand All @@ -297,7 +297,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic]
// CHECK:STDOUT: %.11: type = facet_access_type %Self.4 [symbolic]
// CHECK:STDOUT: %.12: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic]
// CHECK:STDOUT: %.13: %.12 = assoc_entity imports.%import_ref.27, element0 [symbolic]
// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.27 [symbolic]
// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic]
// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic]
// CHECK:STDOUT: %.14: <witness> = interface_witness (%Convert.8) [symbolic]
Expand All @@ -313,7 +313,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template]
// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template]
// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.5, %Convert.type.11 [template]
// CHECK:STDOUT: %.19: %.18 = assoc_entity imports.%import_ref.34, element0 [template]
// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.34 [template]
// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic]
// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic]
// CHECK:STDOUT: %.20: <witness> = interface_witness (%Convert.12) [symbolic]
Expand Down Expand Up @@ -349,8 +349,8 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template]
// CHECK:STDOUT: %.32: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template]
// CHECK:STDOUT: %.33: %.32 = assoc_entity imports.%import_ref.10, element0 [template]
// CHECK:STDOUT: %.34: %.2 = assoc_entity imports.%import_ref.44, element0 [symbolic]
// CHECK:STDOUT: %.33: %.32 = assoc_entity element0, imports.%import_ref.10 [template]
// CHECK:STDOUT: %.34: %.2 = assoc_entity element0, imports.%import_ref.44 [symbolic]
// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.24) [template]
// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
// CHECK:STDOUT: %.35: <witness> = interface_witness (%Convert.14) [template]
Expand Down Expand Up @@ -448,7 +448,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)]
// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity imports.%import_ref.10, element0 [symbolic = %.2 (constants.%.3)]
// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.10 [symbolic = %.2 (constants.%.3)]
// CHECK:STDOUT:
// CHECK:STDOUT: interface {
// CHECK:STDOUT: !members:
Expand All @@ -468,7 +468,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)]
// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)]
// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.12)]
// CHECK:STDOUT: %.2: @As.%.1 (%.12) = assoc_entity imports.%import_ref.27, element0 [symbolic = %.2 (constants.%.13)]
// CHECK:STDOUT: %.2: @As.%.1 (%.12) = assoc_entity element0, imports.%import_ref.27 [symbolic = %.2 (constants.%.13)]
// CHECK:STDOUT:
// CHECK:STDOUT: interface {
// CHECK:STDOUT: !members:
Expand Down Expand Up @@ -1332,7 +1332,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic]
// CHECK:STDOUT: %.22: type = facet_access_type %Self.4 [symbolic]
// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic]
// CHECK:STDOUT: %.24: %.23 = assoc_entity imports.%import_ref.34, element0 [symbolic]
// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.34 [symbolic]
// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.7, @impl.5(%N) [symbolic]
// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic]
// CHECK:STDOUT: %.25: <witness> = interface_witness (%Convert.9) [symbolic]
Expand All @@ -1348,7 +1348,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template]
// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template]
// CHECK:STDOUT: %.29: type = assoc_entity_type %As.type.5, %Convert.type.12 [template]
// CHECK:STDOUT: %.30: %.29 = assoc_entity imports.%import_ref.41, element0 [template]
// CHECK:STDOUT: %.30: %.29 = assoc_entity element0, imports.%import_ref.41 [template]
// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.10, @impl.8(%N) [symbolic]
// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic]
// CHECK:STDOUT: %.31: <witness> = interface_witness (%Convert.13) [symbolic]
Expand Down Expand Up @@ -1421,7 +1421,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)]
// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)]
// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.23)]
// CHECK:STDOUT: %.2: @As.%.1 (%.23) = assoc_entity imports.%import_ref.34, element0 [symbolic = %.2 (constants.%.24)]
// CHECK:STDOUT: %.2: @As.%.1 (%.23) = assoc_entity element0, imports.%import_ref.34 [symbolic = %.2 (constants.%.24)]
// CHECK:STDOUT:
// CHECK:STDOUT: interface {
// CHECK:STDOUT: !members:
Expand Down Expand Up @@ -1945,7 +1945,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
// CHECK:STDOUT: %.1: type = facet_access_type %Self.2 [symbolic]
// CHECK:STDOUT: %.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
// CHECK:STDOUT: %.3: %.2 = assoc_entity imports.%import_ref.10, element0 [symbolic]
// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.10 [symbolic]
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic]
// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic]
// CHECK:STDOUT: %.4: <witness> = interface_witness (%Convert.2) [symbolic]
Expand All @@ -1962,7 +1962,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
// CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template]
// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template]
// CHECK:STDOUT: %.9: %.8 = assoc_entity imports.%import_ref.17, element0 [template]
// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.17 [template]
// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic]
// CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic]
// CHECK:STDOUT: %.10: <witness> = interface_witness (%Convert.6) [symbolic]
Expand All @@ -1974,7 +1974,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic]
// CHECK:STDOUT: %.11: type = facet_access_type %Self.4 [symbolic]
// CHECK:STDOUT: %.12: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic]
// CHECK:STDOUT: %.13: %.12 = assoc_entity imports.%import_ref.27, element0 [symbolic]
// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.27 [symbolic]
// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic]
// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic]
// CHECK:STDOUT: %.14: <witness> = interface_witness (%Convert.8) [symbolic]
Expand All @@ -1990,7 +1990,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template]
// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template]
// CHECK:STDOUT: %.18: type = assoc_entity_type %As.type.5, %Convert.type.11 [template]
// CHECK:STDOUT: %.19: %.18 = assoc_entity imports.%import_ref.34, element0 [template]
// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.34 [template]
// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic]
// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic]
// CHECK:STDOUT: %.20: <witness> = interface_witness (%Convert.12) [symbolic]
Expand Down Expand Up @@ -2076,7 +2076,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)]
// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity imports.%import_ref.10, element0 [symbolic = %.2 (constants.%.3)]
// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.2) = assoc_entity element0, imports.%import_ref.10 [symbolic = %.2 (constants.%.3)]
// CHECK:STDOUT:
// CHECK:STDOUT: interface {
// CHECK:STDOUT: !members:
Expand All @@ -2096,7 +2096,7 @@ class Class(U:! type) {
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)]
// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)]
// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.12)]
// CHECK:STDOUT: %.2: @As.%.1 (%.12) = assoc_entity imports.%import_ref.27, element0 [symbolic = %.2 (constants.%.13)]
// CHECK:STDOUT: %.2: @As.%.1 (%.12) = assoc_entity element0, imports.%import_ref.27 [symbolic = %.2 (constants.%.13)]
// CHECK:STDOUT:
// CHECK:STDOUT: interface {
// CHECK:STDOUT: !members:
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/function/builtin/method.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var arr: [i32; (1 as i32).(I.F)(2)];
// CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
// CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
// CHECK:STDOUT: %.2: type = assoc_entity_type %I.type, %F.type.1 [template]
// CHECK:STDOUT: %.3: %.2 = assoc_entity @I.%F.decl, element0 [template]
// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @I.%F.decl [template]
// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
Expand Down Expand Up @@ -155,7 +155,7 @@ var arr: [i32; (1 as i32).(I.F)(2)];
// CHECK:STDOUT: %return.param: ref @F.1.%.loc12_14.1 (%.1) = out_param runtime_param2
// CHECK:STDOUT: %return: ref @F.1.%.loc12_14.1 (%.1) = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc12: %.2 = assoc_entity %F.decl, element0 [template = constants.%.3]
// CHECK:STDOUT: %.loc12: %.2 = assoc_entity element0, %F.decl [template = constants.%.3]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
Expand Down
Loading

0 comments on commit 71ca1d2

Please sign in to comment.