From 42e22801504dcafc168070c0a8071ca0f95c7912 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Thu, 30 Oct 2025 15:50:59 -0700 Subject: [PATCH] Clean up singleton TypeId use (#6300) #6289 absentmindedly added fields in more places, and this is undoing that plus further fixes. This does some cleanup of types with relation to singletons. For `TypeType` and `ErrorInst`, they're always complete due to a `SetComplete` call in `file.cpp`. For `CppVoidType`, it's intended to be incomplete by construction, and so a `TypeId` should be okay. The intent though on not generally providing these had been that `GetSingletonType` needs to be called to get a type to be marked as complete. In the case of `AutoType`, removing `TypeId`does change a small printing detail. I think that's old legacy that's just been carried forward. Otherwise, for both `InstType` and `AutoType`, I've added `GetSingletonType` calls where they were used in order to ensure completeness is applied correctly. These calls cause small SemIR permutations. This causes `AutoType` to be seen by lowering, so I'm adding a placeholder for it. Also merging two functions that look like they're identical in intent -- not sure why they're separate. --------- Co-authored-by: Dana Jansens --- toolchain/check/action.cpp | 4 +- toolchain/check/convert.cpp | 9 +- toolchain/check/eval.cpp | 20 +-- toolchain/check/handle_binding_pattern.cpp | 3 +- toolchain/check/member_access.cpp | 4 +- .../basics/raw_sem_ir/cpp_interop.carbon | 120 +++++++++--------- .../basics/raw_sem_ir/multifile.carbon | 2 + .../multifile_with_textual_ir.carbon | 2 + .../basics/raw_sem_ir/one_file.carbon | 2 + .../testdata/class/generic/member_type.carbon | 2 +- .../testdata/class/virtual_modifiers.carbon | 2 +- toolchain/check/testdata/deduce/array.carbon | 6 +- toolchain/check/testdata/facet/access.carbon | 2 +- .../testdata/facet/facet_assoc_const.carbon | 4 +- toolchain/check/testdata/for/actual.carbon | 2 +- toolchain/check/testdata/for/basic.carbon | 2 +- .../function/generic/resolve_used.carbon | 2 +- .../generic/template/unimplemented.carbon | 2 +- .../testdata/impl/assoc_const_self.carbon | 2 +- .../impl/fail_undefined_interface.carbon | 2 +- .../check/testdata/impl/forward_decls.carbon | 6 +- .../impl/import_interface_assoc_const.carbon | 6 +- .../check/testdata/impl/lookup/import.carbon | 8 +- .../testdata/impl/use_assoc_const.carbon | 2 +- .../interface/fail_assoc_const_alias.carbon | 2 +- .../testdata/interop/cpp/class/access.carbon | 16 +-- .../testdata/interop/cpp/class/base.carbon | 4 +- .../testdata/interop/cpp/class/class.carbon | 4 +- .../testdata/interop/cpp/class/method.carbon | 8 +- .../interop/cpp/class/template.carbon | 2 +- .../interop/cpp/function/class.carbon | 4 +- .../interop/cpp/function/extern_c.carbon | 2 +- .../interop/cpp/function/pointer.carbon | 10 +- .../interop/cpp/function/struct.carbon | 4 +- .../interop/cpp/function/union.carbon | 4 +- .../interop/cpp/function/void_pointer.carbon | 4 +- .../check/testdata/interop/cpp/typedef.carbon | 2 +- .../testdata/operators/overloaded/dec.carbon | 2 +- .../overloaded/fail_assign_non_ref.carbon | 2 +- .../testdata/operators/overloaded/inc.carbon | 2 +- .../packages/cross_package_export.carbon | 16 +-- .../testdata/packages/export_name.carbon | 3 + .../testdata/where_expr/equal_rewrite.carbon | 4 +- toolchain/docs/adding_features.md | 4 +- toolchain/lower/file_context.cpp | 31 ++--- toolchain/sem_ir/ids.cpp | 2 - toolchain/sem_ir/typed_insts.h | 77 +++++------ 47 files changed, 215 insertions(+), 210 deletions(-) diff --git a/toolchain/check/action.cpp b/toolchain/check/action.cpp index 2426de19f6ae..eec2e8032495 100644 --- a/toolchain/check/action.cpp +++ b/toolchain/check/action.cpp @@ -7,6 +7,7 @@ #include "toolchain/base/kind_switch.h" #include "toolchain/check/generic_region_stack.h" #include "toolchain/check/inst.h" +#include "toolchain/check/type.h" #include "toolchain/sem_ir/constant.h" #include "toolchain/sem_ir/id_kind.h" #include "toolchain/sem_ir/inst.h" @@ -134,7 +135,8 @@ static auto RefineOperand(Context& context, SemIR::LocId loc_id, context, SemIR::LocIdAndInst( loc_id, - SemIR::RefineTypeAction{.type_id = SemIR::InstType::TypeId, + SemIR::RefineTypeAction{.type_id = GetSingletonType( + context, SemIR::InstType::TypeInstId), .inst_id = *inst_id, .inst_type_inst_id = type_inst_id}), type_inst_id); diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 010039457175..e36e927e6002 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -1459,9 +1459,10 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, auto target_type_inst_id = context.types().GetInstId(target.type_id); return AddDependentActionSplice( context, loc_id, - SemIR::ConvertToValueAction{.type_id = SemIR::InstType::TypeId, - .inst_id = expr_id, - .target_type_inst_id = target_type_inst_id}, + SemIR::ConvertToValueAction{ + .type_id = GetSingletonType(context, SemIR::InstType::TypeInstId), + .inst_id = expr_id, + .target_type_inst_id = target_type_inst_id}, target_type_inst_id); } @@ -1735,7 +1736,7 @@ auto ExprAsType(Context& context, SemIR::LocId loc_id, SemIR::InstId value_id, bool diagnose) -> TypeExpr { auto type_inst_id = ConvertToValueOfType(context, loc_id, value_id, SemIR::TypeType::TypeId); - if (type_inst_id == SemIR::ErrorInst::InstId) { + if (type_inst_id == SemIR::ErrorInst::TypeInstId) { return {.inst_id = SemIR::ErrorInst::TypeInstId, .type_id = SemIR::ErrorInst::TypeId}; } diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index a732d8aac564..15321e55197c 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -987,10 +987,9 @@ static auto PerformCheckedCharConvert(Context& context, SemIR::LocId loc_id, static auto MakeIntTypeResult(Context& context, SemIR::LocId loc_id, SemIR::IntKind int_kind, SemIR::InstId width_id, Phase phase) -> SemIR::ConstantId { - auto result = SemIR::IntType{ - .type_id = GetSingletonType(context, SemIR::TypeType::TypeInstId), - .int_kind = int_kind, - .bit_width_id = width_id}; + auto result = SemIR::IntType{.type_id = SemIR::TypeType::TypeId, + .int_kind = int_kind, + .bit_width_id = width_id}; if (!ValidateIntType(context, loc_id, result)) { return SemIR::ErrorInst::ConstantId; } @@ -1002,10 +1001,9 @@ static auto MakeIntTypeResult(Context& context, SemIR::LocId loc_id, static auto MakeFloatTypeResult(Context& context, SemIR::LocId loc_id, SemIR::InstId width_id, Phase phase) -> SemIR::ConstantId { - auto result = SemIR::FloatType{ - .type_id = GetSingletonType(context, SemIR::TypeType::TypeInstId), - .bit_width_id = width_id, - .float_kind = SemIR::FloatKind::None}; + auto result = SemIR::FloatType{.type_id = SemIR::TypeType::TypeId, + .bit_width_id = width_id, + .float_kind = SemIR::FloatKind::None}; if (!ValidateFloatTypeAndSetKind(context, loc_id, result)) { return SemIR::ErrorInst::ConstantId; } @@ -2085,8 +2083,10 @@ static auto TryEvalTypedInst(EvalContext& eval_context, SemIR::InstId inst_id, // The result is an instruction. return MakeConstantResult( eval_context.context(), - SemIR::InstValue{.type_id = SemIR::InstType::TypeId, - .inst_id = result_inst_id}, + SemIR::InstValue{ + .type_id = GetSingletonType(eval_context.context(), + SemIR::InstType::TypeInstId), + .inst_id = result_inst_id}, Phase::Concrete); } // Couldn't perform the action because it's still dependent. diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index a83168fa09e4..35f8df843ba3 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -412,7 +412,8 @@ auto HandleParseNode(Context& context, Parse::AddrId node_id) -> bool { if (pointer_type) { auto addr_pattern_id = AddPatternInst( context, node_id, - {.type_id = GetPatternType(context, SemIR::AutoType::TypeId), + {.type_id = GetPatternType( + context, GetSingletonType(context, SemIR::AutoType::TypeInstId)), .inner_id = param_pattern_id}); context.node_stack().Push(node_id, addr_pattern_id); } else { diff --git a/toolchain/check/member_access.cpp b/toolchain/check/member_access.cpp index 27dcd7c70dad..e45eba586ea5 100644 --- a/toolchain/check/member_access.cpp +++ b/toolchain/check/member_access.cpp @@ -461,13 +461,13 @@ auto PerformMemberAccess(Context& context, SemIR::LocId loc_id, if (required) { return HandleAction( context, loc_id, - {.type_id = SemIR::InstType::TypeId, + {.type_id = GetSingletonType(context, SemIR::InstType::TypeInstId), .base_id = base_id, .name_id = name_id}); } else { return HandleAction( context, loc_id, - {.type_id = SemIR::InstType::TypeId, + {.type_id = GetSingletonType(context, SemIR::InstType::TypeInstId), .base_id = base_id, .name_id = name_id}); } diff --git a/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon b/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon index e58f22cd6dcd..a3113793ada8 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon @@ -44,7 +44,7 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: import_ir_inst00000002: {ir_id: import_ir(Cpp), clang_source_loc_id: clang_source_loc60000002} // CHECK:STDOUT: clang_decls: // CHECK:STDOUT: clang_decl_id60000000: {key: "", inst_id: inst60000010} -// CHECK:STDOUT: clang_decl_id60000001: {key: "struct X {}", inst_id: inst60000012} +// CHECK:STDOUT: clang_decl_id60000001: {key: "struct X {}", inst_id: inst60000013} // CHECK:STDOUT: clang_decl_id60000002: {key: "X * _Nonnull p", inst_id: inst60000021} // CHECK:STDOUT: clang_decl_id60000003: {key: {decl: "void f(X x = {})", num_params: 0}, inst_id: inst6000002C} // CHECK:STDOUT: clang_decl_id60000004: {key: {decl: "extern void f__carbon_thunk()", num_params: 0}, inst_id: inst6000002F} @@ -52,9 +52,9 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: clang_decl_id60000006: {key: {decl: "extern void f__carbon_thunk(X * _Nonnull x)", num_params: 1}, inst_id: inst60000042} // CHECK:STDOUT: clang_decl_id60000007: {key: "X * _Nonnull global", inst_id: inst6000004B} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope00000000: {inst: inst0000000E, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name00000000: inst60000010, name00000001: inst6000001B}} -// CHECK:STDOUT: name_scope60000001: {inst: inst60000010, parent_scope: name_scope00000000, has_error: false, extended_scopes: [], names: {name00000003: inst60000012, name00000004: inst60000029, name00000005: inst6000004B}} -// CHECK:STDOUT: name_scope60000002: {inst: inst60000012, parent_scope: name_scope60000001, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope00000000: {inst: inst0000000E, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name00000000: inst60000010, name00000001: inst6000001C}} +// CHECK:STDOUT: name_scope60000001: {inst: inst60000010, parent_scope: name_scope00000000, has_error: false, extended_scopes: [], names: {name00000003: inst60000013, name00000004: inst60000029, name00000005: inst6000004B}} +// CHECK:STDOUT: name_scope60000002: {inst: inst60000013, parent_scope: name_scope60000001, has_error: false, extended_scopes: [], names: {}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name60000000: {name: name00000002, parent_scope: name_scope, index: -1, is_template: 0} // CHECK:STDOUT: entity_name60000001: {name: name00000002, parent_scope: name_scope, index: -1, is_template: 0} @@ -69,7 +69,7 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: function60000003: {name: name00000004, parent_scope: name_scope60000001, call_params_id: inst_block6000000D} // CHECK:STDOUT: function60000004: {name: name00000007, parent_scope: name_scope60000001, call_params_id: inst_block60000012} // CHECK:STDOUT: classes: -// CHECK:STDOUT: class60000000: {name: name00000003, parent_scope: name_scope60000001, self_type_id: type(inst60000013), inheritance_kind: Base, is_dynamic: 0, scope_id: name_scope60000002, body_block_id: inst_block6000000A, adapt_id: inst, base_id: inst, complete_type_witness_id: inst60000024, vtable_decl_id: inst}} +// CHECK:STDOUT: class60000000: {name: name00000003, parent_scope: name_scope60000001, self_type_id: type(inst60000014), inheritance_kind: Base, is_dynamic: 0, scope_id: name_scope60000002, body_block_id: inst_block6000000A, adapt_id: inst, base_id: inst, complete_type_witness_id: inst60000024, vtable_decl_id: inst}} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} // CHECK:STDOUT: struct_type_fields: @@ -85,10 +85,12 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: value_repr: {kind: copy, type: type(Error)} // CHECK:STDOUT: 'type(inst(NamespaceType))': // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'type(inst6000001C)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)} +// CHECK:STDOUT: 'type(inst(InstType))': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)} +// CHECK:STDOUT: 'type(inst60000012)': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)} // CHECK:STDOUT: 'type(inst6000001D)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)} +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)} // CHECK:STDOUT: 'type(inst(WitnessType))': // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(WitnessType))} // CHECK:STDOUT: 'type(inst6000001F)': @@ -97,18 +99,18 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst60000026)} // CHECK:STDOUT: 'type(inst60000026)': // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst60000026)} -// CHECK:STDOUT: 'type(inst60000013)': +// CHECK:STDOUT: 'type(inst60000014)': // CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst60000026)} // CHECK:STDOUT: 'type(inst60000028)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)} +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)} // CHECK:STDOUT: 'type(inst6000002D)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)} +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)} // CHECK:STDOUT: 'type(inst60000030)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)} +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)} // CHECK:STDOUT: 'type(inst6000003B)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)} +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)} // CHECK:STDOUT: 'type(inst60000043)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)} +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)} // CHECK:STDOUT: insts: // CHECK:STDOUT: 'inst(TypeType)': {kind: TypeType, type: type(TypeType)} // CHECK:STDOUT: 'inst(AutoType)': {kind: AutoType, type: type(TypeType)} @@ -128,21 +130,21 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst6000000F: {kind: ImportCppDecl} // CHECK:STDOUT: inst60000010: {kind: Namespace, arg0: name_scope60000001, arg1: inst6000000F, type: type(inst(NamespaceType))} // CHECK:STDOUT: inst60000011: {kind: NameRef, arg0: name00000000, arg1: inst60000010, type: type(inst(NamespaceType))} -// CHECK:STDOUT: inst60000012: {kind: ClassDecl, arg0: class60000000, arg1: inst_block, type: type(TypeType)} -// CHECK:STDOUT: inst60000013: {kind: ClassType, arg0: class60000000, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: inst60000014: {kind: NameRef, arg0: name00000003, arg1: inst60000012, type: type(TypeType)} -// CHECK:STDOUT: inst60000015: {kind: ValueBinding, arg0: entity_name60000000, arg1: inst60000019, type: type(inst60000013)} -// CHECK:STDOUT: inst60000016: {kind: PatternType, arg0: inst60000013, type: type(TypeType)} -// CHECK:STDOUT: inst60000017: {kind: ValueBindingPattern, arg0: entity_name60000000, type: type(inst60000016)} -// CHECK:STDOUT: inst60000018: {kind: ValueParamPattern, arg0: inst60000017, arg1: call_param0, type: type(inst60000016)} -// CHECK:STDOUT: inst60000019: {kind: ValueParam, arg0: call_param0, arg1: name00000002, type: type(inst60000013)} -// CHECK:STDOUT: inst6000001A: {kind: SpliceBlock, arg0: inst_block60000004, arg1: inst60000014, type: type(TypeType)} -// CHECK:STDOUT: inst6000001B: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block60000008, type: type(inst6000001C)} -// CHECK:STDOUT: inst6000001C: {kind: FunctionType, arg0: function60000000, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: inst6000001D: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} -// CHECK:STDOUT: inst6000001E: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000001C)} -// CHECK:STDOUT: inst6000001F: {kind: PointerType, arg0: inst60000013, type: type(TypeType)} -// CHECK:STDOUT: inst60000020: {kind: UnboundElementType, arg0: inst60000013, arg1: inst6000001F, type: type(TypeType)} +// CHECK:STDOUT: inst60000012: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} +// CHECK:STDOUT: inst60000013: {kind: ClassDecl, arg0: class60000000, arg1: inst_block, type: type(TypeType)} +// CHECK:STDOUT: inst60000014: {kind: ClassType, arg0: class60000000, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst60000015: {kind: NameRef, arg0: name00000003, arg1: inst60000013, type: type(TypeType)} +// CHECK:STDOUT: inst60000016: {kind: ValueBinding, arg0: entity_name60000000, arg1: inst6000001A, type: type(inst60000014)} +// CHECK:STDOUT: inst60000017: {kind: PatternType, arg0: inst60000014, type: type(TypeType)} +// CHECK:STDOUT: inst60000018: {kind: ValueBindingPattern, arg0: entity_name60000000, type: type(inst60000017)} +// CHECK:STDOUT: inst60000019: {kind: ValueParamPattern, arg0: inst60000018, arg1: call_param0, type: type(inst60000017)} +// CHECK:STDOUT: inst6000001A: {kind: ValueParam, arg0: call_param0, arg1: name00000002, type: type(inst60000014)} +// CHECK:STDOUT: inst6000001B: {kind: SpliceBlock, arg0: inst_block60000004, arg1: inst60000015, type: type(TypeType)} +// CHECK:STDOUT: inst6000001C: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block60000008, type: type(inst6000001D)} +// CHECK:STDOUT: inst6000001D: {kind: FunctionType, arg0: function60000000, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst6000001E: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000001D)} +// CHECK:STDOUT: inst6000001F: {kind: PointerType, arg0: inst60000014, type: type(TypeType)} +// CHECK:STDOUT: inst60000020: {kind: UnboundElementType, arg0: inst60000014, arg1: inst6000001F, type: type(TypeType)} // CHECK:STDOUT: inst60000021: {kind: FieldDecl, arg0: name00000006, arg1: element0, type: type(inst60000020)} // CHECK:STDOUT: inst60000022: {kind: CustomLayoutType, arg0: struct_type_fields60000001, arg1: custom_layout60000001, type: type(TypeType)} // CHECK:STDOUT: inst60000023: {kind: CustomLayoutType, arg0: struct_type_fields60000002, arg1: custom_layout60000001, type: type(TypeType)} @@ -160,14 +162,14 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst6000002F: {kind: FunctionDecl, arg0: function60000002, arg1: inst_block_empty, type: type(inst60000030)} // CHECK:STDOUT: inst60000030: {kind: FunctionType, arg0: function60000002, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst60000031: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000030)} -// CHECK:STDOUT: inst60000032: {kind: Call, arg0: inst6000002F, arg1: inst_block_empty, type: type(inst6000001D)} +// CHECK:STDOUT: inst60000032: {kind: Call, arg0: inst6000002F, arg1: inst_block_empty, type: type(inst60000012)} // CHECK:STDOUT: inst60000033: {kind: NameRef, arg0: name00000000, arg1: inst60000010, type: type(inst(NamespaceType))} // CHECK:STDOUT: inst60000034: {kind: NameRef, arg0: name00000004, arg1: inst60000029, type: type(inst60000028)} -// CHECK:STDOUT: inst60000035: {kind: NameRef, arg0: name00000002, arg1: inst60000015, type: type(inst60000013)} -// CHECK:STDOUT: inst60000036: {kind: ValueBinding, arg0: entity_name60000001, arg1: inst60000039, type: type(inst60000013)} -// CHECK:STDOUT: inst60000037: {kind: ValueBindingPattern, arg0: entity_name60000001, type: type(inst60000016)} -// CHECK:STDOUT: inst60000038: {kind: ValueParamPattern, arg0: inst60000037, arg1: call_param0, type: type(inst60000016)} -// CHECK:STDOUT: inst60000039: {kind: ValueParam, arg0: call_param0, arg1: name00000002, type: type(inst60000013)} +// CHECK:STDOUT: inst60000035: {kind: NameRef, arg0: name00000002, arg1: inst60000016, type: type(inst60000014)} +// CHECK:STDOUT: inst60000036: {kind: ValueBinding, arg0: entity_name60000001, arg1: inst60000039, type: type(inst60000014)} +// CHECK:STDOUT: inst60000037: {kind: ValueBindingPattern, arg0: entity_name60000001, type: type(inst60000017)} +// CHECK:STDOUT: inst60000038: {kind: ValueParamPattern, arg0: inst60000037, arg1: call_param0, type: type(inst60000017)} +// CHECK:STDOUT: inst60000039: {kind: ValueParam, arg0: call_param0, arg1: name00000002, type: type(inst60000014)} // CHECK:STDOUT: inst6000003A: {kind: FunctionDecl, arg0: function60000003, arg1: inst_block6000000F, type: type(inst6000003B)} // CHECK:STDOUT: inst6000003B: {kind: FunctionType, arg0: function60000003, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst6000003C: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000003B)} @@ -179,9 +181,9 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst60000042: {kind: FunctionDecl, arg0: function60000004, arg1: inst_block60000014, type: type(inst60000043)} // CHECK:STDOUT: inst60000043: {kind: FunctionType, arg0: function60000004, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst60000044: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000043)} -// CHECK:STDOUT: inst60000045: {kind: ValueAsRef, arg0: inst60000035, type: type(inst60000013)} +// CHECK:STDOUT: inst60000045: {kind: ValueAsRef, arg0: inst60000035, type: type(inst60000014)} // CHECK:STDOUT: inst60000046: {kind: AddrOf, arg0: inst60000045, type: type(inst6000001F)} -// CHECK:STDOUT: inst60000047: {kind: Call, arg0: inst60000042, arg1: inst_block60000016, type: type(inst6000001D)} +// CHECK:STDOUT: inst60000047: {kind: Call, arg0: inst60000042, arg1: inst_block60000016, type: type(inst60000012)} // CHECK:STDOUT: inst60000048: {kind: NameRef, arg0: name00000000, arg1: inst60000010, type: type(inst(NamespaceType))} // CHECK:STDOUT: inst60000049: {kind: NameRef, arg0: name00000004, arg1: inst60000029, type: type(inst60000028)} // CHECK:STDOUT: inst6000004A: {kind: NameRef, arg0: name00000000, arg1: inst60000010, type: type(inst(NamespaceType))} @@ -191,11 +193,11 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst6000004E: {kind: NameBindingDecl, arg0: inst_block60000017} // CHECK:STDOUT: inst6000004F: {kind: NameRef, arg0: name00000005, arg1: inst6000004B, type: type(inst6000001F)} // CHECK:STDOUT: inst60000050: {kind: AcquireValue, arg0: inst6000004F, type: type(inst6000001F)} -// CHECK:STDOUT: inst60000051: {kind: Deref, arg0: inst60000050, type: type(inst60000013)} -// CHECK:STDOUT: inst60000052: {kind: AcquireValue, arg0: inst60000051, type: type(inst60000013)} -// CHECK:STDOUT: inst60000053: {kind: ValueAsRef, arg0: inst60000052, type: type(inst60000013)} +// CHECK:STDOUT: inst60000051: {kind: Deref, arg0: inst60000050, type: type(inst60000014)} +// CHECK:STDOUT: inst60000052: {kind: AcquireValue, arg0: inst60000051, type: type(inst60000014)} +// CHECK:STDOUT: inst60000053: {kind: ValueAsRef, arg0: inst60000052, type: type(inst60000014)} // CHECK:STDOUT: inst60000054: {kind: AddrOf, arg0: inst60000053, type: type(inst6000001F)} -// CHECK:STDOUT: inst60000055: {kind: Call, arg0: inst60000042, arg1: inst_block60000019, type: type(inst6000001D)} +// CHECK:STDOUT: inst60000055: {kind: Call, arg0: inst60000042, arg1: inst_block60000019, type: type(inst60000012)} // CHECK:STDOUT: inst60000056: {kind: Return} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: values: @@ -216,15 +218,15 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst0000000E: concrete_constant(inst0000000E) // CHECK:STDOUT: inst60000010: concrete_constant(inst60000010) // CHECK:STDOUT: inst60000011: concrete_constant(inst60000010) -// CHECK:STDOUT: inst60000012: concrete_constant(inst60000013) -// CHECK:STDOUT: inst60000013: concrete_constant(inst60000013) -// CHECK:STDOUT: inst60000014: concrete_constant(inst60000013) -// CHECK:STDOUT: inst60000016: concrete_constant(inst60000016) +// CHECK:STDOUT: inst60000012: concrete_constant(inst60000012) +// CHECK:STDOUT: inst60000013: concrete_constant(inst60000014) +// CHECK:STDOUT: inst60000014: concrete_constant(inst60000014) +// CHECK:STDOUT: inst60000015: concrete_constant(inst60000014) // CHECK:STDOUT: inst60000017: concrete_constant(inst60000017) // CHECK:STDOUT: inst60000018: concrete_constant(inst60000018) -// CHECK:STDOUT: inst6000001A: concrete_constant(inst60000013) -// CHECK:STDOUT: inst6000001B: concrete_constant(inst6000001E) -// CHECK:STDOUT: inst6000001C: concrete_constant(inst6000001C) +// CHECK:STDOUT: inst60000019: concrete_constant(inst60000019) +// CHECK:STDOUT: inst6000001B: concrete_constant(inst60000014) +// CHECK:STDOUT: inst6000001C: concrete_constant(inst6000001E) // CHECK:STDOUT: inst6000001D: concrete_constant(inst6000001D) // CHECK:STDOUT: inst6000001E: concrete_constant(inst6000001E) // CHECK:STDOUT: inst6000001F: concrete_constant(inst6000001F) @@ -270,10 +272,10 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst6000001B +// CHECK:STDOUT: 0: inst6000001C // CHECK:STDOUT: imports: // CHECK:STDOUT: 0: inst60000010 -// CHECK:STDOUT: 1: inst60000012 +// CHECK:STDOUT: 1: inst60000013 // CHECK:STDOUT: 2: inst60000029 // CHECK:STDOUT: 3: inst6000002C // CHECK:STDOUT: 4: inst6000002F @@ -284,18 +286,18 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block60000004: // CHECK:STDOUT: 0: inst60000011 -// CHECK:STDOUT: 1: inst60000014 +// CHECK:STDOUT: 1: inst60000015 // CHECK:STDOUT: inst_block60000005: -// CHECK:STDOUT: 0: inst60000018 +// CHECK:STDOUT: 0: inst60000019 // CHECK:STDOUT: inst_block60000006: -// CHECK:STDOUT: 0: inst60000019 +// CHECK:STDOUT: 0: inst6000001A // CHECK:STDOUT: inst_block60000007: -// CHECK:STDOUT: 0: inst60000017 -// CHECK:STDOUT: 1: inst60000018 +// CHECK:STDOUT: 0: inst60000018 +// CHECK:STDOUT: 1: inst60000019 // CHECK:STDOUT: inst_block60000008: -// CHECK:STDOUT: 0: inst60000019 -// CHECK:STDOUT: 1: inst6000001A -// CHECK:STDOUT: 2: inst60000015 +// CHECK:STDOUT: 0: inst6000001A +// CHECK:STDOUT: 1: inst6000001B +// CHECK:STDOUT: 2: inst60000016 // CHECK:STDOUT: inst_block60000009: // CHECK:STDOUT: 0: inst60000027 // CHECK:STDOUT: 1: inst6000002B @@ -357,5 +359,5 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst_block6000001A: // CHECK:STDOUT: 0: inst0000000E // CHECK:STDOUT: 1: inst6000000F -// CHECK:STDOUT: 2: inst6000001B +// CHECK:STDOUT: 2: inst6000001C // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon b/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon index 91e617881fde..2aec538fda0c 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon @@ -121,6 +121,8 @@ fn B() { // CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)} // CHECK:STDOUT: 'type(inst50000013)': // CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)} +// CHECK:STDOUT: 'type(inst(InstType))': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)} // CHECK:STDOUT: insts: // CHECK:STDOUT: inst0000000E: {kind: Namespace, arg0: name_scope00000000, arg1: inst, type: type(inst(NamespaceType))} // CHECK:STDOUT: inst5000000F: {kind: ImportDecl, arg0: name00000001} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon b/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon index e1f64011a905..532e0b4445e4 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon @@ -140,6 +140,8 @@ fn B() { // CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)} // CHECK:STDOUT: 'type(inst50000013)': // CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)} +// CHECK:STDOUT: 'type(inst(InstType))': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)} // CHECK:STDOUT: insts: // CHECK:STDOUT: inst0000000E: {kind: Namespace, arg0: name_scope00000000, arg1: inst, type: type(inst(NamespaceType))} // CHECK:STDOUT: inst5000000F: {kind: ImportDecl, arg0: name00000001} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon index d7bac6f5158f..19481390c355 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon @@ -369,6 +369,8 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: value_repr: {kind: copy, type: type(symbolic_constant00000004)} // CHECK:STDOUT: 'type(symbolic_constant00000008)': // CHECK:STDOUT: value_repr: {kind: pointer, type: type(symbolic_constant0000000B)} +// CHECK:STDOUT: 'type(inst(InstType))': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000024)} // CHECK:STDOUT: 'type(inst60000047)': // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst60000047)} // CHECK:STDOUT: 'type(inst(SpecificFunctionType))': diff --git a/toolchain/check/testdata/class/generic/member_type.carbon b/toolchain/check/testdata/class/generic/member_type.carbon index c1401ffc7159..f024841ae51d 100644 --- a/toolchain/check/testdata/class/generic/member_type.carbon +++ b/toolchain/check/testdata/class/generic/member_type.carbon @@ -61,11 +61,11 @@ fn Test() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %T.417: %Copy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.322: type = pattern_type %Copy.type [concrete] // CHECK:STDOUT: %Outer.type: type = generic_class_type @Outer [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Outer.generic: %Outer.type = struct_value () [concrete] // CHECK:STDOUT: %Outer.8c0: type = class_type @Outer, @Outer(%T.417) [symbolic] // CHECK:STDOUT: %Inner.bd5: type = class_type @Inner, @Inner(%T.417) [symbolic] diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index e25af1da3f24..7a41c5f1b38e 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -640,6 +640,7 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Base: type = class_type @Base [concrete] // CHECK:STDOUT: %ptr.454: type = ptr_type [concrete] // CHECK:STDOUT: %struct_type.vptr: type = struct_type {.: %ptr.454} [concrete] @@ -647,7 +648,6 @@ class T2(G2:! type) { // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base [concrete] // CHECK:STDOUT: %pattern_type.fb9: type = pattern_type %Derived [concrete] // CHECK:STDOUT: %Derived.H.type: type = fn_type @Derived.H [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Derived.H: %Derived.H.type = struct_value () [concrete] // CHECK:STDOUT: %Base.H.type: type = fn_type @Base.H [concrete] // CHECK:STDOUT: %Base.H: %Base.H.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 9c4bf217da9e..4c9d8ef1178d 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -323,6 +323,7 @@ fn G() -> i32 { // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] @@ -331,7 +332,6 @@ fn G() -> i32 { // CHECK:STDOUT: %pattern_type.e6e: type = pattern_type %array_type.60b [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] @@ -549,6 +549,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 1 [symbolic] @@ -556,7 +557,6 @@ fn G() -> i32 { // CHECK:STDOUT: %array_type.6e5: type = array_type %N, %T [symbolic] // CHECK:STDOUT: %pattern_type.377: type = pattern_type %array_type.6e5 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.088: = require_complete_type %array_type.6e5 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] @@ -919,6 +919,7 @@ fn G() -> i32 { // CHECK:STDOUT: %D: type = class_type @D [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] @@ -927,7 +928,6 @@ fn G() -> i32 { // CHECK:STDOUT: %pattern_type.e6e: type = pattern_type %array_type.60b [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] diff --git a/toolchain/check/testdata/facet/access.carbon b/toolchain/check/testdata/facet/access.carbon index a5201497ee69..51e4d00f38aa 100644 --- a/toolchain/check/testdata/facet/access.carbon +++ b/toolchain/check/testdata/facet/access.carbon @@ -694,10 +694,10 @@ fn F2(U:! Z) { // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete] // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, @A.%X [concrete] // CHECK:STDOUT: %.Self.439: %A.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.439 [symbolic_self] // CHECK:STDOUT: %A.lookup_impl_witness.1ce: = lookup_impl_witness %.Self.439, @A [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %A.lookup_impl_witness.1ce, element0 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %A_where.type: type = facet_type <@A where %impl.elem0 = %empty_tuple.type> [concrete] // CHECK:STDOUT: %AA: %A_where.type = symbolic_binding AA, 0 [symbolic] // CHECK:STDOUT: %pattern_type.4ea: type = pattern_type %A_where.type [concrete] diff --git a/toolchain/check/testdata/facet/facet_assoc_const.carbon b/toolchain/check/testdata/facet/facet_assoc_const.carbon index 287e60244b2f..ccaaa40648e0 100644 --- a/toolchain/check/testdata/facet/facet_assoc_const.carbon +++ b/toolchain/check/testdata/facet/facet_assoc_const.carbon @@ -99,7 +99,7 @@ library "[[@TEST_NAME]]"; interface L { let W:! type; } -// CHECK:STDERR: fail_two_different_combined_from_bitand.carbon:[[@LINE+4]]:10: error: associated constant `.(L.W)` given two different values `{}` and `()` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: fail_two_different_combined_from_bitand.carbon:[[@LINE+4]]:10: error: associated constant `.(L.W)` given two different values `()` and `{}` [AssociatedConstantWithDifferentValues] // CHECK:STDERR: fn F(T:! (L where .W = {}) & (L where .W = ())) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -685,12 +685,12 @@ fn F(T:! I & J where .I1 = .J1.I2) {} // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, @M.%Y [concrete] // CHECK:STDOUT: %assoc2: %M.assoc_type = assoc_entity element2, @M.%Z [concrete] // CHECK:STDOUT: %.Self.5f5: %M.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.5f5 [symbolic_self] // CHECK:STDOUT: %M.lookup_impl_witness: = lookup_impl_witness %.Self.5f5, @M [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self] // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %M.lookup_impl_witness, element1 [symbolic_self] // CHECK:STDOUT: %impl.elem2: type = impl_witness_access %M.lookup_impl_witness, element2 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index dac7b601f3fa..95229537152c 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -55,12 +55,12 @@ fn Read() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self.3b7: %type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %IntRange.type: type = generic_class_type @IntRange [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IntRange.generic: %IntRange.type = struct_value () [concrete] // CHECK:STDOUT: %IntRange.48b: type = class_type @IntRange, @IntRange(%N) [symbolic] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index 5c4bb11060af..043ded3768d0 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -57,8 +57,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %TrivialRange: type = class_type @TrivialRange [concrete] -// CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %T.417: %Copy.type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %Copy.impl_witness.c9a: = impl_witness imports.%Copy.impl_witness_table.955 [concrete] diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index ba5ed37b0086..6058849abc2a 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -43,12 +43,12 @@ fn CallNegative() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %ErrorIfNIsZero.type: type = fn_type @ErrorIfNIsZero [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ErrorIfNIsZero: %ErrorIfNIsZero.type = struct_value () [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/generic/template/unimplemented.carbon b/toolchain/check/testdata/generic/template/unimplemented.carbon index d23271f1e541..50ae59333f73 100644 --- a/toolchain/check/testdata/generic/template/unimplemented.carbon +++ b/toolchain/check/testdata/generic/template/unimplemented.carbon @@ -248,13 +248,13 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %T.afb: %Destroy.type = symbolic_binding T, 0, template [template] // CHECK:STDOUT: %pattern_type.3ab: type = pattern_type %Destroy.type [concrete] // CHECK:STDOUT: %T.binding.as_type.d87: type = symbolic_binding_type T, 0, template, %T.afb [template] // CHECK:STDOUT: %pattern_type.760: type = pattern_type %T.binding.as_type.d87 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %require_complete.386: = require_complete_type %T.binding.as_type.d87 [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] diff --git a/toolchain/check/testdata/impl/assoc_const_self.carbon b/toolchain/check/testdata/impl/assoc_const_self.carbon index be0f555b69a2..2ff957b15dec 100644 --- a/toolchain/check/testdata/impl/assoc_const_self.carbon +++ b/toolchain/check/testdata/impl/assoc_const_self.carbon @@ -558,12 +558,12 @@ fn CallF() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self.3b7: %type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [concrete] // CHECK:STDOUT: %I.type.f7b: type = facet_type <@I, @I(%N)> [symbolic] // CHECK:STDOUT: %Self.d78: %I.type.f7b = symbolic_binding Self, 1 [symbolic] diff --git a/toolchain/check/testdata/impl/fail_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_undefined_interface.carbon index 4296196fc02c..156eb0bbc576 100644 --- a/toolchain/check/testdata/impl/fail_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_undefined_interface.carbon @@ -212,9 +212,9 @@ impl C as J where .Self impls Incomplete and .T = (); // CHECK:STDOUT: %Incomplete.type: type = facet_type <@Incomplete> [concrete] // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %.Self, @J [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where .Self impls @Incomplete and %impl.elem0 = %empty_tuple.type> [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/forward_decls.carbon b/toolchain/check/testdata/impl/forward_decls.carbon index b569cd4fec3b..ca32f0a5aeaa 100644 --- a/toolchain/check/testdata/impl/forward_decls.carbon +++ b/toolchain/check/testdata/impl/forward_decls.carbon @@ -590,10 +590,10 @@ interface I { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] @@ -721,10 +721,10 @@ interface I { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] @@ -1422,10 +1422,10 @@ interface I { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/import_interface_assoc_const.carbon b/toolchain/check/testdata/impl/import_interface_assoc_const.carbon index 0df3686b770c..1564cabc62e5 100644 --- a/toolchain/check/testdata/impl/import_interface_assoc_const.carbon +++ b/toolchain/check/testdata/impl/import_interface_assoc_const.carbon @@ -606,12 +606,12 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.652 [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I_where.type.a9b: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete] // CHECK:STDOUT: %I.impl_witness.36c: = impl_witness file.%I.impl_witness_table.loc9 [concrete] // CHECK:STDOUT: %I_where.type.08a: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete] @@ -984,12 +984,12 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.652 [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1077,12 +1077,12 @@ impl CD as IF where .F = 0 { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.652 [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index 721191160bd9..0ce62522d908 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -581,12 +581,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: --- use_cf.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.8e5: type = pattern_type %C [concrete] // CHECK:STDOUT: %TestCF.type: type = fn_type @TestCF [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %TestCF: %TestCF.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete] // CHECK:STDOUT: %Self: %HasF.type = symbolic_binding Self, 0 [symbolic] @@ -700,12 +700,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: --- use_df.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %D: type = class_type @D [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.f09: type = pattern_type %D [concrete] // CHECK:STDOUT: %TestDF.type: type = fn_type @TestDF [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %TestDF: %TestDF.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete] // CHECK:STDOUT: %Self: %HasF.type = symbolic_binding Self, 0 [symbolic] @@ -842,12 +842,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: --- use_cg.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.8e5: type = pattern_type %C [concrete] // CHECK:STDOUT: %TestCG.type: type = fn_type @TestCG [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %TestCG: %TestCG.type = struct_value () [concrete] // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [concrete] // CHECK:STDOUT: %Self: %HasG.type = symbolic_binding Self, 0 [symbolic] @@ -984,12 +984,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: --- use_dg.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %D: type = class_type @D [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.f09: type = pattern_type %D [concrete] // CHECK:STDOUT: %TestDG.type: type = fn_type @TestDG [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %TestDG: %TestDG.type = struct_value () [concrete] // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [concrete] // CHECK:STDOUT: %Self: %HasG.type = symbolic_binding Self, 0 [symbolic] diff --git a/toolchain/check/testdata/impl/use_assoc_const.carbon b/toolchain/check/testdata/impl/use_assoc_const.carbon index 8466e6e9b3a2..3874fc10fae7 100644 --- a/toolchain/check/testdata/impl/use_assoc_const.carbon +++ b/toolchain/check/testdata/impl/use_assoc_const.carbon @@ -2484,8 +2484,8 @@ fn F() { // CHECK:STDOUT: %assoc0: %J2.assoc_type = assoc_entity element0, @J2.%U2 [concrete] // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic] // CHECK:STDOUT: %pattern_type.0a6: type = pattern_type %Self.binding.as_type [symbolic] -// CHECK:STDOUT: %J2.F.type: type = fn_type @J2.F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %J2.F.type: type = fn_type @J2.F [concrete] // CHECK:STDOUT: %J2.F: %J2.F.type = struct_value () [concrete] // CHECK:STDOUT: %assoc1: %J2.assoc_type = assoc_entity element1, @J2.%J2.F.decl [concrete] // CHECK:STDOUT: %.Self: %J2.type = symbolic_binding .Self [symbolic_self] diff --git a/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon b/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon index 6d064c04d823..ac94989c0684 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon @@ -284,10 +284,10 @@ interface C { // CHECK:STDOUT: %pattern_type.dfd: type = pattern_type %J2.type [concrete] // CHECK:STDOUT: %V.binding.as_type: type = symbolic_binding_type V, 0, %V [symbolic] // CHECK:STDOUT: %.Self.55f: %I2.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.55f [symbolic_self] // CHECK:STDOUT: %I2.lookup_impl_witness.32c: = lookup_impl_witness %.Self.55f, @I2 [symbolic_self] // CHECK:STDOUT: %impl.elem0.077: type = impl_witness_access %I2.lookup_impl_witness.32c, element0 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I2_where.type: type = facet_type <@I2 where %impl.elem0.077 = %empty_tuple.type> [concrete] // CHECK:STDOUT: %I2.impl_witness.7b7f96.1: = impl_witness file.%I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%V) [symbolic] // CHECK:STDOUT: %Self.4d7: %J2.type = symbolic_binding Self, 0 [symbolic] diff --git a/toolchain/check/testdata/interop/cpp/class/access.carbon b/toolchain/check/testdata/interop/cpp/class/access.carbon index 0d956e4e87d8..2b10c8af3603 100644 --- a/toolchain/check/testdata/interop/cpp/class/access.carbon +++ b/toolchain/check/testdata/interop/cpp/class/access.carbon @@ -1586,10 +1586,10 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: --- import_function_member_public.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %S: type = class_type @S [concrete] // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete] // CHECK:STDOUT: %pattern_type.259: type = pattern_type %ptr.5c7 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %S.instance_fn.cpp_overload_set.type: type = cpp_overload_set_type @S.instance_fn.cpp_overload_set [concrete] // CHECK:STDOUT: %S.instance_fn.cpp_overload_set.value: %S.instance_fn.cpp_overload_set.type = cpp_overload_set_value @S.instance_fn.cpp_overload_set [concrete] // CHECK:STDOUT: %pattern_type.7da: type = pattern_type %S [concrete] @@ -1672,8 +1672,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %C.static_fn.cpp_overload_set.type: type = cpp_overload_set_type @C.static_fn.cpp_overload_set [concrete] // CHECK:STDOUT: %C.static_fn.cpp_overload_set.value: %C.static_fn.cpp_overload_set.type = cpp_overload_set_value @C.static_fn.cpp_overload_set [concrete] // CHECK:STDOUT: %C.static_fn.type: type = fn_type @C.static_fn [concrete] @@ -1833,8 +1833,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %D: type = class_type @D [concrete] -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %struct_type.base.7c3: type = struct_type {.base: %C} [concrete] // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete] // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete] @@ -2110,8 +2110,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] -// CHECK:STDOUT: %Public: type = class_type @Public [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Public: type = class_type @Public [concrete] // CHECK:STDOUT: %Public.Overload.cpp_overload_set.type: type = cpp_overload_set_type @Public.Overload.cpp_overload_set [concrete] // CHECK:STDOUT: %Public.Overload.cpp_overload_set.value: %Public.Overload.cpp_overload_set.type = cpp_overload_set_value @Public.Overload.cpp_overload_set [concrete] // CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete] @@ -2232,8 +2232,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] -// CHECK:STDOUT: %Protected: type = class_type @Protected [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Protected: type = class_type @Protected [concrete] // CHECK:STDOUT: %Protected.Overload.cpp_overload_set.type: type = cpp_overload_set_type @Protected.Overload.cpp_overload_set [concrete] // CHECK:STDOUT: %Protected.Overload.cpp_overload_set.value: %Protected.Overload.cpp_overload_set.type = cpp_overload_set_value @Protected.Overload.cpp_overload_set [concrete] // CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete] @@ -2354,9 +2354,9 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Public: type = class_type @Public [concrete] // CHECK:STDOUT: %Base: type = class_type @Base [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Public.PublicStatic.cpp_overload_set.type: type = cpp_overload_set_type @Public.PublicStatic.cpp_overload_set [concrete] // CHECK:STDOUT: %Public.PublicStatic.cpp_overload_set.value: %Public.PublicStatic.cpp_overload_set.type = cpp_overload_set_value @Public.PublicStatic.cpp_overload_set [concrete] // CHECK:STDOUT: %Base.PublicStatic.type: type = fn_type @Base.PublicStatic [concrete] @@ -2532,9 +2532,9 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Protected: type = class_type @Protected [concrete] // CHECK:STDOUT: %Base: type = class_type @Base [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Protected.PublicStatic.cpp_overload_set.type: type = cpp_overload_set_type @Protected.PublicStatic.cpp_overload_set [concrete] // CHECK:STDOUT: %Protected.PublicStatic.cpp_overload_set.value: %Protected.PublicStatic.cpp_overload_set.type = cpp_overload_set_value @Protected.PublicStatic.cpp_overload_set [concrete] // CHECK:STDOUT: %Base.PublicStatic.type: type = fn_type @Base.PublicStatic [concrete] @@ -2648,10 +2648,10 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %PublicProtected: type = class_type @PublicProtected [concrete] // CHECK:STDOUT: %Protected: type = class_type @Protected [concrete] // CHECK:STDOUT: %Base: type = class_type @Base [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %PublicProtected.PublicStatic.cpp_overload_set.type: type = cpp_overload_set_type @PublicProtected.PublicStatic.cpp_overload_set [concrete] // CHECK:STDOUT: %PublicProtected.PublicStatic.cpp_overload_set.value: %PublicProtected.PublicStatic.cpp_overload_set.type = cpp_overload_set_value @PublicProtected.PublicStatic.cpp_overload_set [concrete] // CHECK:STDOUT: %Base.PublicStatic.type: type = fn_type @Base.PublicStatic [concrete] diff --git a/toolchain/check/testdata/interop/cpp/class/base.carbon b/toolchain/check/testdata/interop/cpp/class/base.carbon index 03bb03e6b63b..9b2290e322ed 100644 --- a/toolchain/check/testdata/interop/cpp/class/base.carbon +++ b/toolchain/check/testdata/interop/cpp/class/base.carbon @@ -361,6 +361,7 @@ class V { // CHECK:STDOUT: --- use_derived_to_base_conversion.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] // CHECK:STDOUT: %ptr.ddb: type = ptr_type %Derived [concrete] // CHECK:STDOUT: %pattern_type.5c8: type = pattern_type %ptr.ddb [concrete] @@ -368,7 +369,6 @@ class V { // CHECK:STDOUT: %ptr.fb2: type = ptr_type %Base [concrete] // CHECK:STDOUT: %pattern_type.72a: type = pattern_type %ptr.fb2 [concrete] // CHECK:STDOUT: %ConvertPtr.type: type = fn_type @ConvertPtr [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ConvertPtr: %ConvertPtr.type = struct_value () [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] @@ -579,8 +579,8 @@ class V { // CHECK:STDOUT: --- use_base_method.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] // CHECK:STDOUT: %Base: type = class_type @Base [concrete] // CHECK:STDOUT: %Derived.f.cpp_overload_set.type: type = cpp_overload_set_type @Derived.f.cpp_overload_set [concrete] // CHECK:STDOUT: %Derived.f.cpp_overload_set.value: %Derived.f.cpp_overload_set.type = cpp_overload_set_value @Derived.f.cpp_overload_set [concrete] diff --git a/toolchain/check/testdata/interop/cpp/class/class.carbon b/toolchain/check/testdata/interop/cpp/class/class.carbon index eeadd0465723..b07b1e71ea3a 100644 --- a/toolchain/check/testdata/interop/cpp/class/class.carbon +++ b/toolchain/check/testdata/interop/cpp/class/class.carbon @@ -456,11 +456,11 @@ fn MyF(bar: Cpp.Bar*); // CHECK:STDOUT: --- call_dynamic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Bar: type = class_type @Bar [concrete] // CHECK:STDOUT: %ptr.f68: type = ptr_type %Bar [concrete] // CHECK:STDOUT: %pattern_type.146: type = pattern_type %ptr.f68 [concrete] // CHECK:STDOUT: %MyF.type: type = fn_type @MyF [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %MyF: %MyF.type = struct_value () [concrete] // CHECK:STDOUT: %Bar.f.cpp_overload_set.type: type = cpp_overload_set_type @Bar.f.cpp_overload_set [concrete] // CHECK:STDOUT: %Bar.f.cpp_overload_set.value: %Bar.f.cpp_overload_set.type = cpp_overload_set_value @Bar.f.cpp_overload_set [concrete] @@ -516,8 +516,8 @@ fn MyF(bar: Cpp.Bar*); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] -// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Bar [concrete] // CHECK:STDOUT: %struct_type.base.36d: type = struct_type {.base: %Bar} [concrete] // CHECK:STDOUT: %complete_type.fff: = complete_type_witness %struct_type.base.36d [concrete] diff --git a/toolchain/check/testdata/interop/cpp/class/method.carbon b/toolchain/check/testdata/interop/cpp/class/method.carbon index 5489049ecb96..fd03e83f2678 100644 --- a/toolchain/check/testdata/interop/cpp/class/method.carbon +++ b/toolchain/check/testdata/interop/cpp/class/method.carbon @@ -240,11 +240,11 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: --- use_object_param_qualifiers.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %HasQualifiers: type = class_type @HasQualifiers [concrete] // CHECK:STDOUT: %pattern_type.e15: type = pattern_type %HasQualifiers [concrete] // CHECK:STDOUT: %ptr.ec3: type = ptr_type %HasQualifiers [concrete] // CHECK:STDOUT: %pattern_type.bc1: type = pattern_type %ptr.ec3 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %HasQualifiers.const_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.const_this.cpp_overload_set [concrete] // CHECK:STDOUT: %HasQualifiers.const_this.cpp_overload_set.value: %HasQualifiers.const_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_this.cpp_overload_set [concrete] // CHECK:STDOUT: %const_this__carbon_thunk.type: type = fn_type @const_this__carbon_thunk [concrete] @@ -336,11 +336,11 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: --- use_object_param_qualifiers_overloaded.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %HasQualifiers: type = class_type @HasQualifiers [concrete] // CHECK:STDOUT: %pattern_type.e15: type = pattern_type %HasQualifiers [concrete] // CHECK:STDOUT: %ptr.ec3: type = ptr_type %HasQualifiers [concrete] // CHECK:STDOUT: %pattern_type.bc1: type = pattern_type %ptr.ec3 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] @@ -433,9 +433,9 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: --- call_explicit_object_param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ExplicitObjectParam: type = class_type @ExplicitObjectParam [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Another: type = class_type @Another [concrete] @@ -514,9 +514,9 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: --- call_explicit_object_param_overloaded.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ExplicitObjectParam: type = class_type @ExplicitObjectParam [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Another: type = class_type @Another [concrete] diff --git a/toolchain/check/testdata/interop/cpp/class/template.carbon b/toolchain/check/testdata/interop/cpp/class/template.carbon index 1b3fb763914e..ce84c119b504 100644 --- a/toolchain/check/testdata/interop/cpp/class/template.carbon +++ b/toolchain/check/testdata/interop/cpp/class/template.carbon @@ -83,9 +83,9 @@ var y: Cpp.Xint.r#type = 0; // CHECK:STDOUT: --- use_class_template.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %A.0bedf0.1: type = class_type @A.1 [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Base: type = class_type @Base [concrete] diff --git a/toolchain/check/testdata/interop/cpp/function/class.carbon b/toolchain/check/testdata/interop/cpp/function/class.carbon index 70535bfb98c8..2f9311be17ed 100644 --- a/toolchain/check/testdata/interop/cpp/function/class.carbon +++ b/toolchain/check/testdata/interop/cpp/function/class.carbon @@ -1054,9 +1054,9 @@ fn F() { // CHECK:STDOUT: --- import_decl_pointer_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %C [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] @@ -1090,9 +1090,9 @@ fn F() { // CHECK:STDOUT: --- import_definition_pointer_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %C [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] diff --git a/toolchain/check/testdata/interop/cpp/function/extern_c.carbon b/toolchain/check/testdata/interop/cpp/function/extern_c.carbon index e5b31bc45ef4..714736f1d644 100644 --- a/toolchain/check/testdata/interop/cpp/function/extern_c.carbon +++ b/toolchain/check/testdata/interop/cpp/function/extern_c.carbon @@ -205,8 +205,8 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X { // CHECK:STDOUT: --- extern_c_with_special_name.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %X: type = class_type @X [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %X: type = class_type @X [concrete] // CHECK:STDOUT: %ptr.1f9: type = ptr_type %X [concrete] // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete] // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete] diff --git a/toolchain/check/testdata/interop/cpp/function/pointer.carbon b/toolchain/check/testdata/interop/cpp/function/pointer.carbon index 741f41828e74..87c0af8896aa 100644 --- a/toolchain/check/testdata/interop/cpp/function/pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/pointer.carbon @@ -482,11 +482,11 @@ fn F() { // CHECK:STDOUT: --- import_const_value_pointer_param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %S: type = class_type @S [concrete] // CHECK:STDOUT: %const: type = const_type %S [concrete] // CHECK:STDOUT: %pattern_type.9be: type = pattern_type %const [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] @@ -547,12 +547,12 @@ fn F() { // CHECK:STDOUT: --- fail_todo_import_const_pointer_param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %S: type = class_type @S [concrete] // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete] // CHECK:STDOUT: %const.b9a: type = const_type %ptr.5c7 [concrete] // CHECK:STDOUT: %pattern_type.f25: type = pattern_type %const.b9a [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] @@ -632,10 +632,10 @@ fn F() { // CHECK:STDOUT: --- import_pointer_return.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %S: type = class_type @S [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %S [concrete] // CHECK:STDOUT: %IngestDoublePointer.type: type = fn_type @IngestDoublePointer [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IngestDoublePointer: %IngestDoublePointer.type = struct_value () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] @@ -676,11 +676,11 @@ fn F() { // CHECK:STDOUT: --- import_double_pointer_return.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %S: type = class_type @S [concrete] // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete] // CHECK:STDOUT: %ptr.dfe: type = ptr_type %ptr.5c7 [concrete] // CHECK:STDOUT: %IngestDoublePointer.type: type = fn_type @IngestDoublePointer [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IngestDoublePointer: %IngestDoublePointer.type = struct_value () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] @@ -721,11 +721,11 @@ fn F() { // CHECK:STDOUT: --- import_const_pointer_return.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %S: type = class_type @S [concrete] // CHECK:STDOUT: %const: type = const_type %S [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %const [concrete] // CHECK:STDOUT: %IngestConstPointer.type: type = fn_type @IngestConstPointer [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IngestConstPointer: %IngestConstPointer.type = struct_value () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] diff --git a/toolchain/check/testdata/interop/cpp/function/struct.carbon b/toolchain/check/testdata/interop/cpp/function/struct.carbon index a496f9d12df8..fe1dbc629028 100644 --- a/toolchain/check/testdata/interop/cpp/function/struct.carbon +++ b/toolchain/check/testdata/interop/cpp/function/struct.carbon @@ -1053,9 +1053,9 @@ fn F() { // CHECK:STDOUT: --- import_decl_pointer_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %S: type = class_type @S [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %S [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] @@ -1089,9 +1089,9 @@ fn F() { // CHECK:STDOUT: --- import_definition_pointer_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %S: type = class_type @S [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %S [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] diff --git a/toolchain/check/testdata/interop/cpp/function/union.carbon b/toolchain/check/testdata/interop/cpp/function/union.carbon index 07f37923f21a..0b1340f77628 100644 --- a/toolchain/check/testdata/interop/cpp/function/union.carbon +++ b/toolchain/check/testdata/interop/cpp/function/union.carbon @@ -990,9 +990,9 @@ fn F() { // CHECK:STDOUT: --- import_decl_pointer_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %U: type = class_type @U [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %U [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] @@ -1026,9 +1026,9 @@ fn F() { // CHECK:STDOUT: --- import_definition_pointer_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %U: type = class_type @U [concrete] // CHECK:STDOUT: %ptr: type = ptr_type %U [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] diff --git a/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon b/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon index 154930998afa..58b995ecb993 100644 --- a/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/void_pointer.carbon @@ -127,8 +127,8 @@ fn F() { // CHECK:STDOUT: --- non_nullable_param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %ptr: type = ptr_type Cpp.void [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %ptr: type = ptr_type Cpp.void [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] @@ -205,8 +205,8 @@ fn F() { // CHECK:STDOUT: --- nullable_param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %ptr.03c: type = ptr_type Cpp.void [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %ptr.03c: type = ptr_type Cpp.void [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] diff --git a/toolchain/check/testdata/interop/cpp/typedef.carbon b/toolchain/check/testdata/interop/cpp/typedef.carbon index 478816479e31..ff66a00ddbe0 100644 --- a/toolchain/check/testdata/interop/cpp/typedef.carbon +++ b/toolchain/check/testdata/interop/cpp/typedef.carbon @@ -163,8 +163,8 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: --- use_class_typedef.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.a31: type = pattern_type %ptr.d9e [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 4fef3942b408..d9db0969ed8a 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -33,12 +33,12 @@ fn TestOp() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Dec.type: type = facet_type <@Dec> [concrete] // CHECK:STDOUT: %Dec.Op.type: type = fn_type @Dec.Op [concrete] // CHECK:STDOUT: %Dec.impl_witness: = impl_witness file.%Dec.impl_witness_table [concrete] // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %C.as.Dec.impl.Op.type: type = fn_type @C.as.Dec.impl.Op [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %C.as.Dec.impl.Op: %C.as.Dec.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %Dec.facet: %Dec.type = facet_value %C, (%Dec.impl_witness) [concrete] // CHECK:STDOUT: %.475: type = fn_type_with_self_type %Dec.Op.type, %Dec.facet [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index 20c07c4025e5..198f3a1c84d5 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -51,6 +51,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Inc.type: type = facet_type <@Inc> [concrete] // CHECK:STDOUT: %Inc.Op.type: type = fn_type @Inc.Op [concrete] // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete] @@ -58,7 +59,6 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete] // CHECK:STDOUT: %C.as.Inc.impl.Op.type: type = fn_type @C.as.Inc.impl.Op [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %C.as.Inc.impl.Op: %C.as.Inc.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %Inc.facet: %Inc.type = facet_value %C, (%Inc.impl_witness) [concrete] // CHECK:STDOUT: %AddAssignWith.type.fc6: type = generic_interface_type @AddAssignWith [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 18093725fad7..2bb9b181142e 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -33,12 +33,12 @@ fn TestOp() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Inc.type: type = facet_type <@Inc> [concrete] // CHECK:STDOUT: %Inc.Op.type: type = fn_type @Inc.Op [concrete] // CHECK:STDOUT: %Inc.impl_witness: = impl_witness file.%Inc.impl_witness_table [concrete] // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete] // CHECK:STDOUT: %C.as.Inc.impl.Op.type: type = fn_type @C.as.Inc.impl.Op [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %C.as.Inc.impl.Op: %C.as.Inc.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %Inc.facet: %Inc.type = facet_value %C, (%Inc.impl_witness) [concrete] // CHECK:STDOUT: %.35f: type = fn_type_with_self_type %Inc.Op.type, %Inc.facet [concrete] diff --git a/toolchain/check/testdata/packages/cross_package_export.carbon b/toolchain/check/testdata/packages/cross_package_export.carbon index 6e8c1b2774e4..c932cf152ed5 100644 --- a/toolchain/check/testdata/packages/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/cross_package_export.carbon @@ -382,8 +382,8 @@ alias C = Other.C; // CHECK:STDOUT: --- use_export_import.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] @@ -446,8 +446,8 @@ alias C = Other.C; // CHECK:STDOUT: --- use_export_import_with_copy.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] @@ -511,8 +511,8 @@ alias C = Other.C; // CHECK:STDOUT: --- use_export_import_indirect.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] @@ -576,8 +576,8 @@ alias C = Other.C; // CHECK:STDOUT: --- use_export_name.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] @@ -639,8 +639,8 @@ alias C = Other.C; // CHECK:STDOUT: --- use_export_name_with_copy.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] @@ -703,8 +703,8 @@ alias C = Other.C; // CHECK:STDOUT: --- use_export_name_indirect.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] @@ -766,8 +766,8 @@ alias C = Other.C; // CHECK:STDOUT: --- use_export_all.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] @@ -898,8 +898,8 @@ alias C = Other.C; // CHECK:STDOUT: --- fail_conflict_on_export_name.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [concrete] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/export_name.carbon b/toolchain/check/testdata/packages/export_name.carbon index c7e8a2060949..e094c713b56d 100644 --- a/toolchain/check/testdata/packages/export_name.carbon +++ b/toolchain/check/testdata/packages/export_name.carbon @@ -958,6 +958,9 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_use_not_reexporting.carbon // CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .C = diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index c7c40e24d8d0..cc6227a01f94 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -282,6 +282,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, @A.%B [concrete] // CHECK:STDOUT: %assoc1: %A.assoc_type = assoc_entity element1, @A.%C [concrete] // CHECK:STDOUT: %.Self.439: %A.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.439 [symbolic_self] // CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %.Self.439, @A [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %A.lookup_impl_witness, element0 [symbolic_self] @@ -289,7 +290,6 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %A_where.type.75b: type = facet_type <@A where %impl.elem0 = bool> [concrete] // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %A.lookup_impl_witness, element1 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %A_where.type.27d: type = facet_type <@A where %impl.elem0 = bool and %impl.elem1 = %empty_tuple.type> [concrete] // CHECK:STDOUT: %D: %A_where.type.27d = symbolic_binding D, 0 [symbolic] // CHECK:STDOUT: %pattern_type.f94: type = pattern_type %A_where.type.27d [concrete] @@ -486,10 +486,10 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%K [concrete] // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%L [concrete] // CHECK:STDOUT: %.Self.c58: %J.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.c58 [symbolic_self] // CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %.Self.c58, @J [symbolic_self] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %J.lookup_impl_witness, element1 [symbolic_self] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] diff --git a/toolchain/docs/adding_features.md b/toolchain/docs/adding_features.md index 870c67c5810d..2b71b5c5a195 100644 --- a/toolchain/docs/adding_features.md +++ b/toolchain/docs/adding_features.md @@ -304,11 +304,11 @@ If the resulting SemIR needs a new instruction: constructed as a special-case in [`File` construction](/toolchain/sem_ir/file.cpp). To get a type id for one of these builtin types, use something like - `GetSingletonType(context,SemIR::WitnessType::InstId)`, as in: + `GetSingletonType(context,SemIR::WitnessType::TypeInstId)`, as in: ``` SemIR::TypeId witness_type_id = - GetSingletonType(context, SemIR::WitnessType::InstId); + GetSingletonType(context, SemIR::WitnessType::TypeInstId); SemIR::InstId inst_id = AddInst( context, node_id, {.type_id = witness_type_id, ...}); ``` diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 3c3068dbc27e..cc808f4f477b 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -783,11 +783,6 @@ static auto BuildTypeForInst(FileContext& context, SemIR::ArrayType inst) *context.sem_ir().GetArrayBoundValue(inst.bound_id)); } -static auto BuildTypeForInst(FileContext& /*context*/, SemIR::AutoType inst) - -> llvm::Type* { - CARBON_FATAL("Unexpected builtin type in lowering: {0}", inst); -} - static auto BuildTypeForInst(FileContext& context, SemIR::BoolType /*inst*/) -> llvm::Type* { // TODO: We may want to have different representations for `bool` storage @@ -900,23 +895,15 @@ static auto BuildTypeForInst(FileContext& context, } template - requires(InstT::Kind - .template IsAnyOf()) -static auto BuildTypeForInst(FileContext& context, InstT /*inst*/) - -> llvm::Type* { - // Return an empty struct as a placeholder. - return llvm::StructType::get(context.llvm_context()); -} - -template - requires(InstT::Kind.template IsAnyOf< - SemIR::AssociatedEntityType, SemIR::CppOverloadSetType, - SemIR::CppVoidType, SemIR::FacetType, SemIR::FunctionType, - SemIR::FunctionTypeWithSelfType, SemIR::GenericClassType, - SemIR::GenericInterfaceType, SemIR::GenericNamedConstraintType, - SemIR::InstType, SemIR::UnboundElementType, SemIR::WhereExpr>()) + requires( + InstT::Kind.template IsAnyOf< + SemIR::AssociatedEntityType, SemIR::AutoType, SemIR::BoundMethodType, + SemIR::CharLiteralType, SemIR::CppOverloadSetType, SemIR::CppVoidType, + SemIR::FacetType, SemIR::FloatLiteralType, SemIR::FunctionType, + SemIR::FunctionTypeWithSelfType, SemIR::GenericClassType, + SemIR::GenericInterfaceType, SemIR::GenericNamedConstraintType, + SemIR::InstType, SemIR::IntLiteralType, SemIR::NamespaceType, + SemIR::WhereExpr, SemIR::WitnessType, SemIR::UnboundElementType>()) static auto BuildTypeForInst(FileContext& context, InstT /*inst*/) -> llvm::Type* { // Return an empty struct as a placeholder. diff --git a/toolchain/sem_ir/ids.cpp b/toolchain/sem_ir/ids.cpp index 64d6e45da763..93f54fdbc9bc 100644 --- a/toolchain/sem_ir/ids.cpp +++ b/toolchain/sem_ir/ids.cpp @@ -209,8 +209,6 @@ auto TypeId::Print(llvm::raw_ostream& out) const -> void { out << Label << "("; if (*this == TypeType::TypeId) { out << "TypeType"; - } else if (*this == AutoType::TypeId) { - out << "AutoType"; } else if (*this == ErrorInst::TypeId) { out << "Error"; } else { diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index d70ce14e9cd5..94fde245c328 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -52,18 +52,21 @@ namespace Carbon::SemIR { -// A template for singleton types. +// A template for singleton types. Most uses will not add members, and so may +// apply a `using` alias. Some children add static members; non-static members +// must not be added. +// +// For a `TypeId`, `GetSingletonType` should generally be used so that the type +// is completed when referenced. In a few cases where completeness is always +// known (particularly `TypeType` and `ErrorInst`), a `TypeId` may be provided +// by a child. template -struct SingletonTypeInst final { +struct SingletonTypeInst { static constexpr auto Kind = InstKind::Make(KindT).Define( InstKind::DefinitionInfo{.ir_name = IrName, .is_type = InstIsType::Always, .constant_kind = InstConstantKind::Always}); static constexpr auto TypeInstId = MakeSingletonTypeInstId(); - static constexpr SemIR::InstId InstId = TypeInstId; - static constexpr auto ConstantId = ConstantId::ForConcreteConstant(InstId); - static constexpr auto TypeId = - TypeId::ForTypeConstant(ConstantId::ForConcreteConstant(TypeInstId)); // Singleton types have a type of `TypeType`, except for `ErrorInst` which // uses itself. @@ -491,18 +494,6 @@ struct ConstType { TypeInstId inner_id; }; -struct PartialType { - static constexpr auto Kind = - InstKind::PartialType.Define( - {.ir_name = "partial_type", - .is_type = InstIsType::Always, - .constant_kind = InstConstantKind::Conditional, - .deduce_through = true}); - - TypeId type_id; - TypeInstId inner_id; -}; - // Records that a type conversion `original as new_type` was done, producing the // result. struct Converted { @@ -531,18 +522,11 @@ struct ConvertToValueAction { }; // A type for C++ `void`. Should only be used for pointers (`void*`). -struct CppVoidType { - static constexpr auto Kind = InstKind::CppVoidType.Define( - {.ir_name = "Cpp.void", - .is_type = InstIsType::Always, - .constant_kind = InstConstantKind::Always, - .is_lowered = false}); - - static constexpr auto TypeInstId = MakeSingletonTypeInstId(); +struct CppVoidType + : public SingletonTypeInst { + // `Cpp.void` is never complete, so `GetSingletonType` won't work. static constexpr auto TypeId = TypeId::ForTypeConstant(ConstantId::ForConcreteConstant(TypeInstId)); - - SemIR::TypeId type_id; }; // A type whose layout is determined externally. This is used as the object @@ -572,7 +556,15 @@ struct Deref { // required. For example, when there is a type checking issue, this will be used // in the type_id. It's typically used as a cue that semantic checking doesn't // need to issue further diagnostics. -using ErrorInst = SingletonTypeInst">; +struct ErrorInst : public SingletonTypeInst"> { + // Convenience for returning error InstIds and ConstantIds directly. + static constexpr InstId InstId = TypeInstId; + static constexpr auto ConstantId = + ConstantId::ForConcreteConstant(TypeInstId); + + // `ErrorInst` is always set complete in file.cpp. + static constexpr auto TypeId = TypeId::ForTypeConstant(ConstantId); +}; // An `export bind_name` declaration. struct ExportDecl { @@ -1226,6 +1218,19 @@ struct OutParamPattern { CallParamIndex index; }; +// Indicates `partial` on a type, such as `partial MyClass`. +struct PartialType { + static constexpr auto Kind = + InstKind::PartialType.Define( + {.ir_name = "partial_type", + .is_type = InstIsType::Always, + .constant_kind = InstConstantKind::Conditional, + .deduce_through = true}); + + TypeId type_id; + TypeInstId inner_id; +}; + // The type of a pattern that matches scrutinees of type // `scrutinee_type_inst_id`. struct PatternType { @@ -1785,7 +1790,11 @@ struct TypeOfInst { // Tracks expressions which are valid as types. This has a deliberately // self-referential type. -using TypeType = SingletonTypeInst; +struct TypeType : public SingletonTypeInst { + // `TypeType` is always set complete in file.cpp. + static constexpr auto TypeId = + TypeId::ForTypeConstant(ConstantId::ForConcreteConstant(TypeInstId)); +}; // The `not` operator, such as `not operand`. struct UnaryOperatorNot { @@ -1986,15 +1995,11 @@ concept HasUntypedNodeId = // HasKindMemberAsField is true if T has a `InstKind kind` field, as opposed // to a `static constexpr InstKind::Definition Kind` member or no kind at all. template -concept HasKindMemberAsField = requires { - { &T::kind } -> std::same_as; -}; +concept HasKindMemberAsField = std::same_as; // HasTypeIdMember is true if T has a `TypeId type_id` field. template -concept HasTypeIdMember = requires { - { &T::type_id } -> std::same_as; -}; +concept HasTypeIdMember = std::same_as; } // namespace Internal