Make SemIR::TypeType be an empty FacetType instruction (#7813)

The type `type` is now a `FacetType` inst with no constraints. This
brings the model implemented in the toolchain into better alignment with
the language design. The `SemIR::TypeType` struct remains as a scope for
holding the `TypeInstId`, `ConstantId`, and `TypeId` constants, but is
not an `InstKind` anymore.

The `TypeType` inst looks a lot like singletons, but there are many
`FacetType` insts so it doesn't quite fit that model. So we put it
alongside singletons with a fixed inst id but refer to it as a more
general "builtin" inst that is not a singleton.
`Namespace::PackageInstId` is similar, and we group it with `TypeType`
conceptually as another builtin instruction with a fixed id.

No conversion is needed anymore to use a `type` as a facet, since types
also have a `FacetType` type. This simplifies and removes a number of
helpers and branches throughout the code.

The `TypeType` inst is now part of the constant store, so we end up
printing it in the constants block in every test. But it's also named
`type` rather than `%type` to preserve the majority of existing
formatting behaviour, though this does look different from other
constants.

Assisted-by: Opus 5 was used to generate a first draft and validate the
refactoring. Though nearly everything non-trivial the tool wrote has
been modified or rewritten.
This commit is contained in:
Dana Jansens
2026-09-22 15:04:40 +00:00
committed by GitHub
parent 83ca5b71e3
commit fcae9610bd
795 changed files with 9505 additions and 8048 deletions
+19 -17
View File
@@ -54,10 +54,11 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed";
// CHECK:STDOUT: --- adapt.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.805: Core.Form = init_form type [concrete]
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
// CHECK:STDOUT: %return.param_patt.70e: %pattern_type.98f = out_param_pattern [concrete]
// CHECK:STDOUT: %return.patt.3ae: %pattern_type.98f = return_slot_pattern %return.param_patt.70e, type [concrete]
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %.576: Core.Form = init_form type [concrete]
// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete]
// CHECK:STDOUT: %return.param_patt.90b: %pattern_type.9a5 = out_param_pattern [concrete]
// CHECK:STDOUT: %return.patt.718: %pattern_type.9a5 = return_slot_pattern %return.param_patt.90b, type [concrete]
// CHECK:STDOUT: %MakeIntLiteral.type: type = fn_type @MakeIntLiteral [concrete]
// CHECK:STDOUT: %MakeIntLiteral: %MakeIntLiteral.type = struct_value () [concrete]
// CHECK:STDOUT: %MyIntLiteral: type = class_type @MyIntLiteral [concrete]
@@ -108,11 +109,11 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed";
// CHECK:STDOUT: .v = %v
// CHECK:STDOUT: }
// CHECK:STDOUT: %MakeIntLiteral.decl: %MakeIntLiteral.type = fn_decl @MakeIntLiteral [concrete = constants.%MakeIntLiteral] {
// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete = constants.%return.param_patt.70e]
// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc4_24.1 [concrete = constants.%return.patt.3ae]
// CHECK:STDOUT: %return.param_patt: %pattern_type.9a5 = out_param_pattern [concrete = constants.%return.param_patt.90b]
// CHECK:STDOUT: %return.patt: %pattern_type.9a5 = return_slot_pattern %return.param_patt, %.loc4_24.1 [concrete = constants.%return.patt.718]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc4_24.1: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc4_24.2: Core.Form = init_form %.loc4_24.1 [concrete = constants.%.805]
// CHECK:STDOUT: %.loc4_24.2: Core.Form = init_form %.loc4_24.1 [concrete = constants.%.576]
// CHECK:STDOUT: %return.param: ref type = out_param call_param0
// CHECK:STDOUT: %return: ref type = return_slot %return.param
// CHECK:STDOUT: }
@@ -125,11 +126,11 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed";
// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] {
// CHECK:STDOUT: %N.param_patt: %pattern_type.129 = value_param_pattern [concrete = constants.%N.param_patt]
// CHECK:STDOUT: %N.patt: %pattern_type.129 = wrapper_binding_pattern N, %N.param_patt [concrete = constants.%N.patt]
// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete = constants.%return.param_patt.70e]
// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc11_28.1 [concrete = constants.%return.patt.3ae]
// CHECK:STDOUT: %return.param_patt: %pattern_type.9a5 = out_param_pattern [concrete = constants.%return.param_patt.90b]
// CHECK:STDOUT: %return.patt: %pattern_type.9a5 = return_slot_pattern %return.param_patt, %.loc11_28.1 [concrete = constants.%return.patt.718]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc11_28.1: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc11_28.2: Core.Form = init_form %.loc11_28.1 [concrete = constants.%.805]
// CHECK:STDOUT: %.loc11_28.2: Core.Form = init_form %.loc11_28.1 [concrete = constants.%.576]
// CHECK:STDOUT: %N.param: %MyIntLiteral = value_param call_param0
// CHECK:STDOUT: %MyIntLiteral.ref: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral]
// CHECK:STDOUT: %N: %MyIntLiteral = wrapper_binding N, %N.param
@@ -262,6 +263,7 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed";
// CHECK:STDOUT: --- fail_bad_adapt.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %MyIntLiteral: type = class_type @MyIntLiteral [concrete]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
@@ -269,10 +271,10 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed";
// CHECK:STDOUT: %pattern_type.129: type = pattern_type %MyIntLiteral [concrete]
// CHECK:STDOUT: %N.param_patt: %pattern_type.129 = value_param_pattern [concrete]
// CHECK:STDOUT: %N.patt: %pattern_type.129 = wrapper_binding_pattern N, %N.param_patt [concrete]
// CHECK:STDOUT: %.805: Core.Form = init_form type [concrete]
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete]
// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, type [concrete]
// CHECK:STDOUT: %.576: Core.Form = init_form type [concrete]
// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.9a5 = out_param_pattern [concrete]
// CHECK:STDOUT: %return.patt: %pattern_type.9a5 = return_slot_pattern %return.param_patt, type [concrete]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
// CHECK:STDOUT: }
@@ -286,11 +288,11 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed";
// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] {
// CHECK:STDOUT: %N.param_patt: %pattern_type.129 = value_param_pattern [concrete = constants.%N.param_patt]
// CHECK:STDOUT: %N.patt: %pattern_type.129 = wrapper_binding_pattern N, %N.param_patt [concrete = constants.%N.patt]
// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete = constants.%return.param_patt]
// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc12_28.1 [concrete = constants.%return.patt]
// CHECK:STDOUT: %return.param_patt: %pattern_type.9a5 = out_param_pattern [concrete = constants.%return.param_patt]
// CHECK:STDOUT: %return.patt: %pattern_type.9a5 = return_slot_pattern %return.param_patt, %.loc12_28.1 [concrete = constants.%return.patt]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc12_28.1: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc12_28.2: Core.Form = init_form %.loc12_28.1 [concrete = constants.%.805]
// CHECK:STDOUT: %.loc12_28.2: Core.Form = init_form %.loc12_28.1 [concrete = constants.%.576]
// CHECK:STDOUT: %N.param: %MyIntLiteral = value_param call_param0
// CHECK:STDOUT: %MyIntLiteral.ref: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral]
// CHECK:STDOUT: %N: %MyIntLiteral = wrapper_binding N, %N.param
+1
View File
@@ -23,6 +23,7 @@ fn RuntimeCall(a: i32, b: i32) -> i32 {
// CHECK:STDOUT: --- call.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
@@ -58,10 +58,11 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: --- core.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.805: Core.Form = init_form type [concrete]
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
// CHECK:STDOUT: %return.param_patt.70e: %pattern_type.98f = out_param_pattern [concrete]
// CHECK:STDOUT: %return.patt.3ae: %pattern_type.98f = return_slot_pattern %return.param_patt.70e, type [concrete]
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %.576: Core.Form = init_form type [concrete]
// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete]
// CHECK:STDOUT: %return.param_patt.90b: %pattern_type.9a5 = out_param_pattern [concrete]
// CHECK:STDOUT: %return.patt.718: %pattern_type.9a5 = return_slot_pattern %return.param_patt.90b, type [concrete]
// CHECK:STDOUT: %MakeIntLiteral.type: type = fn_type @MakeIntLiteral [concrete]
// CHECK:STDOUT: %MakeIntLiteral: %MakeIntLiteral.type = struct_value () [concrete]
// CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
@@ -69,9 +70,8 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %N.patt: %pattern_type.dc0 = wrapper_binding_pattern N, %N.param_patt [concrete]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self]
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %AddWith.type.2ef: type = generic_interface_type @AddWith [concrete]
// CHECK:STDOUT: %AddWith.generic: %AddWith.type.2ef = struct_value () [concrete]
@@ -197,11 +197,11 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %MakeIntLiteral.decl: %MakeIntLiteral.type = fn_decl @MakeIntLiteral [concrete = constants.%MakeIntLiteral] {
// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete = constants.%return.param_patt.70e]
// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc4_24.1 [concrete = constants.%return.patt.3ae]
// CHECK:STDOUT: %return.param_patt: %pattern_type.9a5 = out_param_pattern [concrete = constants.%return.param_patt.90b]
// CHECK:STDOUT: %return.patt: %pattern_type.9a5 = return_slot_pattern %return.param_patt, %.loc4_24.1 [concrete = constants.%return.patt.718]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc4_24.1: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc4_24.2: Core.Form = init_form %.loc4_24.1 [concrete = constants.%.805]
// CHECK:STDOUT: %.loc4_24.2: Core.Form = init_form %.loc4_24.1 [concrete = constants.%.576]
// CHECK:STDOUT: %return.param: ref type = out_param call_param0
// CHECK:STDOUT: %return: ref type = return_slot %return.param
// CHECK:STDOUT: }
@@ -213,11 +213,11 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] {
// CHECK:STDOUT: %N.param_patt: %pattern_type.dc0 = value_param_pattern [concrete = constants.%N.param_patt]
// CHECK:STDOUT: %N.patt: %pattern_type.dc0 = wrapper_binding_pattern N, %N.param_patt [concrete = constants.%N.patt]
// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete = constants.%return.param_patt.70e]
// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc6_26.1 [concrete = constants.%return.patt.3ae]
// CHECK:STDOUT: %return.param_patt: %pattern_type.9a5 = out_param_pattern [concrete = constants.%return.param_patt.90b]
// CHECK:STDOUT: %return.patt: %pattern_type.9a5 = return_slot_pattern %return.param_patt, %.loc6_26.1 [concrete = constants.%return.patt.718]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc6_26.1: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc6_26.2: Core.Form = init_form %.loc6_26.1 [concrete = constants.%.805]
// CHECK:STDOUT: %.loc6_26.2: Core.Form = init_form %.loc6_26.1 [concrete = constants.%.576]
// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param call_param0
// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral]
// CHECK:STDOUT: %N: Core.IntLiteral = wrapper_binding N, %N.param
@@ -225,28 +225,28 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %return: ref type = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %AddWith.decl: %AddWith.type.2ef = interface_decl @AddWith [concrete = constants.%AddWith.generic] {
// CHECK:STDOUT: %T.patt.loc8_20.1: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_20.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.patt.loc8_20.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_20.2 (constants.%T.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc8_22.1: type = splice_block %.loc8_22.2 [concrete = type] {
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %.loc8_22.2: type = type_literal type [concrete = type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.loc8_20.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_20.1 (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %As.decl: %As.type.116 = interface_decl @As [concrete = constants.%As.generic] {
// CHECK:STDOUT: %T.patt.loc12_15.1: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_15.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.patt.loc12_15.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_15.2 (constants.%T.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc12_17.1: type = splice_block %.loc12_17.2 [concrete = type] {
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %.loc12_17.2: type = type_literal type [concrete = type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.loc12_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc12_15.1 (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.0ff = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] {
// CHECK:STDOUT: %T.patt.loc16_23.1: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc16_23.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.patt.loc16_23.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc16_23.2 (constants.%T.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc16_25.1: type = splice_block %.loc16_25.2 [concrete = type] {
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %.loc16_25.2: type = type_literal type [concrete = type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.loc16_23.2: type = symbolic_binding T, 0 [symbolic = %T.loc16_23.1 (constants.%T)]
@@ -282,7 +282,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @AddWith(%T.loc8_20.2: type) {
// CHECK:STDOUT: %T.patt.loc8_20.2: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_20.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.patt.loc8_20.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_20.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc8_20.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_20.1 (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -338,7 +338,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @As(%T.loc12_15.2: type) {
// CHECK:STDOUT: %T.patt.loc12_15.2: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_15.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.patt.loc12_15.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_15.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc12_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc12_15.1 (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -383,7 +383,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @ImplicitAs(%T.loc16_23.2: type) {
// CHECK:STDOUT: %T.patt.loc16_23.2: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc16_23.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.patt.loc16_23.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc16_23.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc16_23.1: type = symbolic_binding T, 0 [symbolic = %T.loc16_23.1 (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -839,17 +839,18 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: --- user.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete]
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
// CHECK:STDOUT: %As.type.116: type = generic_interface_type @As [concrete]
// CHECK:STDOUT: %As.generic: %As.type.116 = struct_value () [concrete]
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %As.type.c5f: type = facet_type <@As, @As(%T)> [symbolic]
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %Self.37a: %As.type.c5f = symbolic_binding Self, 1 [symbolic]
// CHECK:STDOUT: %As.assoc_type.b40: type = assoc_entity_type @As, @As(%T) [symbolic]
// CHECK:STDOUT: %As.WithSelf.Convert.type.ff8: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%T, %Self.37a) [symbolic]
@@ -1072,7 +1073,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @As(imports.%Core.import_ref.b3bc94.3: type) [from "core.carbon"] {
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -1090,7 +1091,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @AddWith(imports.%Core.import_ref.b3bc94.6: type) [from "core.carbon"] {
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -1108,7 +1109,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.b3bc94.9: type) [from "core.carbon"] {
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -17,6 +17,7 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: --- definition.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
@@ -45,6 +45,7 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: --- fail_redefined.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
@@ -21,6 +21,7 @@ fn UnknownBuiltin() = "unknown.builtin.name";
// CHECK:STDOUT: --- fail_unknown.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %UnknownBuiltin.type: type = fn_type @UnknownBuiltin [concrete]
// CHECK:STDOUT: %UnknownBuiltin: %UnknownBuiltin.type = struct_value () [concrete]
// CHECK:STDOUT: }
+12 -10
View File
@@ -35,10 +35,11 @@ var arr: array(i32, Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2))
// CHECK:STDOUT: --- core.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.805: Core.Form = init_form type [concrete]
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
// CHECK:STDOUT: %return.param_patt.70e: %pattern_type.98f = out_param_pattern [concrete]
// CHECK:STDOUT: %return.patt.3ae: %pattern_type.98f = return_slot_pattern %return.param_patt.70e, type [concrete]
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %.576: Core.Form = init_form type [concrete]
// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete]
// CHECK:STDOUT: %return.param_patt.90b: %pattern_type.9a5 = out_param_pattern [concrete]
// CHECK:STDOUT: %return.patt.718: %pattern_type.9a5 = return_slot_pattern %return.param_patt.90b, type [concrete]
// CHECK:STDOUT: %MakeIntLiteral.type: type = fn_type @MakeIntLiteral [concrete]
// CHECK:STDOUT: %MakeIntLiteral: %MakeIntLiteral.type = struct_value () [concrete]
// CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
@@ -79,11 +80,11 @@ var arr: array(i32, Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2))
// CHECK:STDOUT: .TestAdd = %TestAdd.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %MakeIntLiteral.decl: %MakeIntLiteral.type = fn_decl @MakeIntLiteral [concrete = constants.%MakeIntLiteral] {
// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete = constants.%return.param_patt.70e]
// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc5_24.1 [concrete = constants.%return.patt.3ae]
// CHECK:STDOUT: %return.param_patt: %pattern_type.9a5 = out_param_pattern [concrete = constants.%return.param_patt.90b]
// CHECK:STDOUT: %return.patt: %pattern_type.9a5 = return_slot_pattern %return.param_patt, %.loc5_24.1 [concrete = constants.%return.patt.718]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc5_24.1: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc5_24.2: Core.Form = init_form %.loc5_24.1 [concrete = constants.%.805]
// CHECK:STDOUT: %.loc5_24.2: Core.Form = init_form %.loc5_24.1 [concrete = constants.%.576]
// CHECK:STDOUT: %return.param: ref type = out_param call_param0
// CHECK:STDOUT: %return: ref type = return_slot %return.param
// CHECK:STDOUT: }
@@ -95,11 +96,11 @@ var arr: array(i32, Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2))
// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] {
// CHECK:STDOUT: %N.param_patt: %pattern_type.dc0 = value_param_pattern [concrete = constants.%N.param_patt]
// CHECK:STDOUT: %N.patt: %pattern_type.dc0 = wrapper_binding_pattern N, %N.param_patt [concrete = constants.%N.patt]
// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete = constants.%return.param_patt.70e]
// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc7_26.1 [concrete = constants.%return.patt.3ae]
// CHECK:STDOUT: %return.param_patt: %pattern_type.9a5 = out_param_pattern [concrete = constants.%return.param_patt.90b]
// CHECK:STDOUT: %return.patt: %pattern_type.9a5 = return_slot_pattern %return.param_patt, %.loc7_26.1 [concrete = constants.%return.patt.718]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc7_26.1: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc7_26.2: Core.Form = init_form %.loc7_26.1 [concrete = constants.%.805]
// CHECK:STDOUT: %.loc7_26.2: Core.Form = init_form %.loc7_26.1 [concrete = constants.%.576]
// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param call_param0
// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral]
// CHECK:STDOUT: %N: Core.IntLiteral = wrapper_binding N, %N.param
@@ -168,6 +169,7 @@ var arr: array(i32, Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2))
// CHECK:STDOUT: --- use.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
@@ -26,6 +26,7 @@ var arr: array(i32, (1 as i32).(I.F)(2));
// CHECK:STDOUT: --- method.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
// CHECK:STDOUT: %Self.37e: %I.type = symbolic_binding Self, 0 [symbolic]
// CHECK:STDOUT: %Self.as_type.c84: type = facet_access_type %Self.37e [symbolic]
@@ -37,6 +37,7 @@ fn Mul = "int.smul";
// CHECK:STDOUT: --- fail_positional.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]