Add a type_literal instruction to represent syntactic type literals. (#6781)

This allows us to capture the location at which a type literal was used,
even in the cases where we don't otherwise need to create a new
instruction to represent the type such as for `char` or `str`.

The logic used to build the underlying type is now marked as desugaring.
For cases such as `iN`, this causes the call to `Core.Int` to no longer
be added as a dedicated IR instruction, and instead its constant value
is used directly as the value of the `type_literal`. This results in
this being on balance a reduction in the size of the IR.

This also fixes a crash in C++ interop when using a `char` literal as a
template argument. The crash was caused by the template argument not
having an associated location when mapping to a C++ location. See
changes to check/testdata/interop/cpp/template/type_param.carbon for an
example that used to crash before this change.

Update alias handling to allow an alias to point at any type literal,
reinstating support for aliases for type literals such as `bool` and
`i32` that had previously worked but stopped working when we
transitioned those types to being defined in the prelude. See changes to
toolchain/check/testdata/alias/builtins.carbon.

All the test changes other than the two mentioned above are mechanical
autoupdate changes switching to the new instruction.
This commit is contained in:
Richard Smith
2026-02-26 20:10:50 +00:00
committed by GitHub
parent 96f163f114
commit f9ab963bd6
337 changed files with 5372 additions and 6077 deletions
+4 -8
View File
@@ -92,8 +92,7 @@ fn F() -> i32 {
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc15: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %.loc15: Core.Form = init_form %i32.loc15, call_param0 [concrete = constants.%.437]
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
@@ -113,12 +112,9 @@ fn F() -> i32 {
// CHECK:STDOUT: %specific_fn.loc16: <specific function> = specific_function %impl.elem0.loc16, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc16_3.2: <bound method> = bound_method %int_0, %specific_fn.loc16 [concrete = constants.%bound_method]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc16_3.2(%int_0) [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc16_3: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: assign %n.var, %.loc16_3
// CHECK:STDOUT: %.loc16_10: type = splice_block %i32.loc16 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc16: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: assign %n.var, %.loc16
// CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %n: ref %i32 = ref_binding n, %n.var
// CHECK:STDOUT: %n.ref: ref %i32 = name_ref n, %n
// CHECK:STDOUT: %addr.loc17_13: %ptr.235 = addr_of %n.ref
+10 -20
View File
@@ -159,10 +159,8 @@ fn F() {
// CHECK:STDOUT: %.loc16_3: init %struct_type.a.b.501 = converted %.loc16_46.1, %.loc16_46.8 [concrete = constants.%struct.ed5]
// CHECK:STDOUT: assign %s.var, %.loc16_3
// CHECK:STDOUT: %.loc16_27: type = splice_block %struct_type.a.b.loc16 [concrete = constants.%struct_type.a.b.501] {
// CHECK:STDOUT: %int_32.loc16_15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc16_15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %int_32.loc16_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc16_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc16_15: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc16_24: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %struct_type.a.b.loc16: type = struct_type {.a: %i32, .b: %i32} [concrete = constants.%struct_type.a.b.501]
// CHECK:STDOUT: }
// CHECK:STDOUT: %s: ref %struct_type.a.b.501 = ref_binding s, %s.var
@@ -180,10 +178,8 @@ fn F() {
// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc18: init %ptr.3ee = call %bound_method.loc18_39.2(%addr.loc18)
// CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call.loc18
// CHECK:STDOUT: %.loc18: type = splice_block %ptr.loc18 [concrete = constants.%ptr.3ee] {
// CHECK:STDOUT: %int_32.loc18_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc18_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %int_32.loc18_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc18_31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc18_22: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc18_31: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %struct_type.a.b.loc18: type = struct_type {.a: %i32, .b: %i32} [concrete = constants.%struct_type.a.b.501]
// CHECK:STDOUT: %ptr.loc18: type = ptr_type %struct_type.a.b.loc18 [concrete = constants.%ptr.3ee]
// CHECK:STDOUT: }
@@ -203,8 +199,7 @@ fn F() {
// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc19: init %ptr.235 = call %bound_method.loc19_24.2(%addr.loc19)
// CHECK:STDOUT: assign %q.var, %ptr.as.Copy.impl.Op.call.loc19
// CHECK:STDOUT: %.loc19_20: type = splice_block %ptr.loc19 [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc19: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc19: type = ptr_type %i32.loc19 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %q: ref %ptr.235 = ref_binding q, %q.var
@@ -223,8 +218,7 @@ fn F() {
// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc20: init %ptr.235 = call %bound_method.loc20_24.2(%addr.loc20)
// CHECK:STDOUT: assign %r.var, %ptr.as.Copy.impl.Op.call.loc20
// CHECK:STDOUT: %.loc20_20: type = splice_block %ptr.loc20 [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc20: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc20: type = ptr_type %i32.loc20 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %r: ref %ptr.235 = ref_binding r, %r.var
@@ -256,10 +250,8 @@ fn F() {
// CHECK:STDOUT: %.loc22_3: init %tuple.type.d07 = converted %.loc22_28.1, %.loc22_28.6 [concrete = constants.%tuple.21c]
// CHECK:STDOUT: assign %t.var, %.loc22_3
// CHECK:STDOUT: %.loc22_19.1: type = splice_block %.loc22_19.3 [concrete = constants.%tuple.type.d07] {
// CHECK:STDOUT: %int_32.loc22_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc22_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %int_32.loc22_16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc22_16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc22_11: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc22_16: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %.loc22_19.2: %tuple.type.24b = tuple_literal (%i32.loc22_11, %i32.loc22_16) [concrete = constants.%tuple.95a]
// CHECK:STDOUT: %.loc22_19.3: type = converted %.loc22_19.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
// CHECK:STDOUT: }
@@ -280,8 +272,7 @@ fn F() {
// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc23: init %ptr.235 = call %bound_method.loc23_25.2(%addr.loc23)
// CHECK:STDOUT: assign %t0.var, %ptr.as.Copy.impl.Op.call.loc23
// CHECK:STDOUT: %.loc23: type = splice_block %ptr.loc23 [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc23: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc23: type = ptr_type %i32.loc23 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %t0: ref %ptr.235 = ref_binding t0, %t0.var
@@ -301,8 +292,7 @@ fn F() {
// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call.loc24: init %ptr.235 = call %bound_method.loc24_25.2(%addr.loc24)
// CHECK:STDOUT: assign %t1.var, %ptr.as.Copy.impl.Op.call.loc24
// CHECK:STDOUT: %.loc24: type = splice_block %ptr.loc24 [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc24: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc24: type = ptr_type %i32.loc24 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %t1: ref %ptr.235 = ref_binding t1, %t1.var
+5 -10
View File
@@ -109,8 +109,7 @@ fn F() -> i32 {
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc15: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %.loc15: Core.Form = init_form %i32.loc15, call_param0 [concrete = constants.%.437]
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
@@ -130,12 +129,9 @@ fn F() -> i32 {
// CHECK:STDOUT: %specific_fn.loc16: <specific function> = specific_function %impl.elem0.loc16, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc16_3.2: <bound method> = bound_method %int_0, %specific_fn.loc16 [concrete = constants.%bound_method]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc16_3.2(%int_0) [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc16_3: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: assign %n.var, %.loc16_3
// CHECK:STDOUT: %.loc16_10: type = splice_block %i32.loc16 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc16: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: assign %n.var, %.loc16
// CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %n: ref %i32 = ref_binding n, %n.var
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %p.patt: %pattern_type.fe8 = ref_binding_pattern p [concrete]
@@ -151,8 +147,7 @@ fn F() -> i32 {
// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.235 = call %bound_method.loc17_17.2(%addr)
// CHECK:STDOUT: assign %p.var, %ptr.as.Copy.impl.Op.call
// CHECK:STDOUT: %.loc17: type = splice_block %ptr [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc17: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc17 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: ref %ptr.235 = ref_binding p, %p.var
+2 -8
View File
@@ -53,18 +53,12 @@ let n2: i32 = undeclared->foo;
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %n.patt: %pattern_type.7ce = value_binding_pattern n [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc19: type = splice_block %i32.loc19 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %i32.loc19: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %n: %i32 = value_binding n, <error> [concrete = <error>]
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %n2.patt: %pattern_type.7ce = value_binding_pattern n2 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc24: type = splice_block %i32.loc24 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %i32.loc24: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %n2: %i32 = value_binding n2, <error> [concrete = <error>]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -81,10 +81,7 @@ fn Deref(n: i32) {
// CHECK:STDOUT: %n.param_patt: %pattern_type.7ce = value_param_pattern %n.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %n.param: %i32 = value_param call_param0
// CHECK:STDOUT: %.loc15: type = splice_block %i32 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %n: %i32 = value_binding n, %n.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
+2 -4
View File
@@ -57,8 +57,7 @@ var p2: i32->foo;
// CHECK:STDOUT: }
// CHECK:STDOUT: %p.var: ref <error> = var %p.var_patt [concrete = <error>]
// CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc22: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %.loc22: ref <error> = deref %i32.loc22 [concrete = <error>]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: ref <error> = ref_binding p, <error> [concrete = <error>]
@@ -68,8 +67,7 @@ var p2: i32->foo;
// CHECK:STDOUT: }
// CHECK:STDOUT: %p2.var: ref <error> = var %p2.var_patt [concrete = <error>]
// CHECK:STDOUT: %.2: <error> = splice_block <error> [concrete = <error>] {
// CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc27: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %.loc27: ref <error> = deref %i32.loc27 [concrete = <error>]
// CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [concrete = <error>]
// CHECK:STDOUT: }
+3 -8
View File
@@ -97,10 +97,7 @@ var a: i32* = a_ref;
// CHECK:STDOUT: %a_orig.var_patt: %pattern_type.7ce = var_pattern %a_orig.patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a_orig.var: ref %i32 = var %a_orig.var_patt [concrete]
// CHECK:STDOUT: %.loc4: type = splice_block %i32.loc4 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %i32.loc4: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %a_orig: ref %i32 = ref_binding a_orig, %a_orig.var [concrete = %a_orig.var]
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %a_ref.patt: %pattern_type.fe8 = ref_binding_pattern a_ref [concrete]
@@ -108,8 +105,7 @@ var a: i32* = a_ref;
// CHECK:STDOUT: }
// CHECK:STDOUT: %a_ref.var: ref %ptr.235 = var %a_ref.var_patt [concrete]
// CHECK:STDOUT: %.loc5: type = splice_block %ptr [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc5 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a_ref: ref %ptr.235 = ref_binding a_ref, %a_ref.var [concrete = %a_ref.var]
@@ -192,8 +188,7 @@ var a: i32* = a_ref;
// CHECK:STDOUT: }
// CHECK:STDOUT: %a.var: ref %ptr.9e1 = var %a.var_patt [concrete]
// CHECK:STDOUT: %.loc4: type = splice_block %ptr [concrete = constants.%ptr.9e1] {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete = constants.%ptr.9e1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a: ref %ptr.9e1 = ref_binding a, %a.var [concrete = %a.var]
+2 -4
View File
@@ -79,14 +79,12 @@ fn F(p: const (const (const i32*)*)) -> const i32 {
// CHECK:STDOUT: %return.patt: %pattern_type.a65 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.a65 = out_param_pattern %return.patt, call_param1 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc16_47: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc16_47: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc16_47: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %const.loc16_41: type = const_type %i32.loc16_47 [concrete = constants.%const.20a]
// CHECK:STDOUT: %.loc16_41: Core.Form = init_form %const.loc16_41, call_param1 [concrete = constants.%.f4c]
// CHECK:STDOUT: %p.param: %const.fa2 = value_param call_param0
// CHECK:STDOUT: %.loc16_9: type = splice_block %const.loc16_9 [concrete = constants.%const.fa2] {
// CHECK:STDOUT: %int_32.loc16_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc16_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc16_29: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %const.loc16_23: type = const_type %i32.loc16_29 [concrete = constants.%const.20a]
// CHECK:STDOUT: %ptr.loc16_32: type = ptr_type %const.loc16_23 [concrete = constants.%ptr.36b]
// CHECK:STDOUT: %const.loc16_16: type = const_type %ptr.loc16_32 [concrete = constants.%const.58f]
+4 -8
View File
@@ -84,14 +84,12 @@ fn ConstPtr(p: const i32*) -> (const i32)* {
// CHECK:STDOUT: %return.patt: %pattern_type.fe8 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.fe8 = out_param_pattern %return.patt, call_param1 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc15_20: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc15_20: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc15_20: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc15_23: type = ptr_type %i32.loc15_20 [concrete = constants.%ptr.235]
// CHECK:STDOUT: %.loc15_23: Core.Form = init_form %ptr.loc15_23, call_param1 [concrete = constants.%.85d]
// CHECK:STDOUT: %p.param: %ptr.235 = value_param call_param0
// CHECK:STDOUT: %.loc15_14: type = splice_block %ptr.loc15_14 [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc15_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc15_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc15_11: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc15_14: type = ptr_type %i32.loc15_11 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: %ptr.235 = value_binding p, %p.param
@@ -104,15 +102,13 @@ fn ConstPtr(p: const i32*) -> (const i32)* {
// CHECK:STDOUT: %return.patt: %pattern_type.bff = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.bff = out_param_pattern %return.patt, call_param1 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc19_38: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc19_38: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc19_38: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %const.loc19_32: type = const_type %i32.loc19_38 [concrete = constants.%const.20a]
// CHECK:STDOUT: %ptr.loc19_42: type = ptr_type %const.loc19_32 [concrete = constants.%ptr.36b]
// CHECK:STDOUT: %.loc19_42: Core.Form = init_form %ptr.loc19_42, call_param1 [concrete = constants.%.78f]
// CHECK:STDOUT: %p.param: %ptr.36b = value_param call_param0
// CHECK:STDOUT: %.loc19_25: type = splice_block %ptr.loc19_25 [concrete = constants.%ptr.36b] {
// CHECK:STDOUT: %int_32.loc19_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc19_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc19_22: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %const.loc19_16: type = const_type %i32.loc19_22 [concrete = constants.%const.20a]
// CHECK:STDOUT: %ptr.loc19_25: type = ptr_type %const.loc19_16 [concrete = constants.%ptr.36b]
// CHECK:STDOUT: }