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
+10 -10
View File
@@ -19,12 +19,12 @@ fn F() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_value 0 [template]
// CHECK:STDOUT: %.3: type = ptr_type i32 [template]
// CHECK:STDOUT: %.1: i32 = int_value 0 [template]
// CHECK:STDOUT: %.2: type = ptr_type i32 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -63,19 +63,19 @@ fn F() -> i32 {
// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32]
// CHECK:STDOUT: %n.var: ref i32 = var n
// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var
// CHECK:STDOUT: %.loc12_16: i32 = int_value 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc12_16: i32 = int_value 0 [template = constants.%.1]
// CHECK:STDOUT: assign %n.var, %.loc12_16
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32]
// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32]
// CHECK:STDOUT: %.loc13_13.3: type = ptr_type i32 [template = constants.%.3]
// CHECK:STDOUT: %p.var: ref %.3 = var p
// CHECK:STDOUT: %p: ref %.3 = bind_name p, %p.var
// CHECK:STDOUT: %.loc13_13.3: type = ptr_type i32 [template = constants.%.2]
// CHECK:STDOUT: %p.var: ref %.2 = var p
// CHECK:STDOUT: %p: ref %.2 = bind_name p, %p.var
// CHECK:STDOUT: %n.ref: ref i32 = name_ref n, %n
// CHECK:STDOUT: %.loc13_17: %.3 = addr_of %n.ref
// CHECK:STDOUT: %.loc13_17: %.2 = addr_of %n.ref
// CHECK:STDOUT: assign %p.var, %.loc13_17
// CHECK:STDOUT: %p.ref: ref %.3 = name_ref p, %p
// CHECK:STDOUT: %.loc15_11: %.3 = bind_value %p.ref
// CHECK:STDOUT: %p.ref: ref %.2 = name_ref p, %p
// CHECK:STDOUT: %.loc15_11: %.2 = bind_value %p.ref
// CHECK:STDOUT: %.loc15_10.1: ref i32 = deref %.loc15_11
// CHECK:STDOUT: %.loc15_10.2: i32 = bind_value %.loc15_10.1
// CHECK:STDOUT: return %.loc15_10.2