Name empty tuples distinctly in SemIR. (#4503)

Building on #4502, give empty tuple values a distinct name, and also
explicitly name tuple types (previously values but not types were
named).
This commit is contained in:
Jon Ross-Perkins
2024-11-08 17:14:52 +00:00
committed by GitHub
parent bbeb66b5fe
commit 10e256a241
585 changed files with 14742 additions and 14732 deletions
+14 -14
View File
@@ -19,12 +19,12 @@ fn G(T:! type) {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_value 0 [template]
// CHECK:STDOUT: %.3: type = array_type %.2, %T [symbolic]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic]
// CHECK:STDOUT: %array: %.3 = tuple_value () [symbolic]
// CHECK:STDOUT: %.1: i32 = int_value 0 [template]
// CHECK:STDOUT: %.2: type = array_type %.1, %T [symbolic]
// CHECK:STDOUT: %.3: type = ptr_type %.2 [symbolic]
// CHECK:STDOUT: %array: %.2 = tuple_value () [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -54,19 +54,19 @@ fn G(T:! type) {
// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %.loc13_17.2: type = array_type constants.%.2, @G.%T.loc11_6.2 (%T) [symbolic = %.loc13_17.2 (constants.%.3)]
// CHECK:STDOUT: %array: @G.%.loc13_17.2 (%.3) = tuple_value () [symbolic = %array (constants.%array)]
// CHECK:STDOUT: %.loc13_17.2: type = array_type constants.%.1, @G.%T.loc11_6.2 (%T) [symbolic = %.loc13_17.2 (constants.%.2)]
// CHECK:STDOUT: %array: @G.%.loc13_17.2 (%.2) = tuple_value () [symbolic = %array (constants.%array)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)]
// CHECK:STDOUT: %.loc13_16: i32 = int_value 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_17.1: type = array_type %.loc13_16, %T [symbolic = %.loc13_17.2 (constants.%.3)]
// CHECK:STDOUT: %arr.var: ref @G.%.loc13_17.2 (%.3) = var arr
// CHECK:STDOUT: %arr: ref @G.%.loc13_17.2 (%.3) = bind_name arr, %arr.var
// CHECK:STDOUT: %.loc13_22.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc13_22.2: init @G.%.loc13_17.2 (%.3) = array_init () to %arr.var [symbolic = %array (constants.%array)]
// CHECK:STDOUT: %.loc13_23: init @G.%.loc13_17.2 (%.3) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %array (constants.%array)]
// CHECK:STDOUT: %.loc13_16: i32 = int_value 0 [template = constants.%.1]
// CHECK:STDOUT: %.loc13_17.1: type = array_type %.loc13_16, %T [symbolic = %.loc13_17.2 (constants.%.2)]
// CHECK:STDOUT: %arr.var: ref @G.%.loc13_17.2 (%.2) = var arr
// CHECK:STDOUT: %arr: ref @G.%.loc13_17.2 (%.2) = bind_name arr, %arr.var
// CHECK:STDOUT: %.loc13_22.1: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %.loc13_22.2: init @G.%.loc13_17.2 (%.2) = array_init () to %arr.var [symbolic = %array (constants.%array)]
// CHECK:STDOUT: %.loc13_23: init @G.%.loc13_17.2 (%.2) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %array (constants.%array)]
// CHECK:STDOUT: assign %arr.var, %.loc13_23
// CHECK:STDOUT: return
// CHECK:STDOUT: }