Format types in SemIR using the formatting for their instruction. (#4035)

Don't use the pretty-printed type name, because that's intended for
diagnostics, not for a theoretically machine-readable format like SemIR.

Types are always constants, so omit the leading `constant.` on the type
instruction name.
This commit is contained in:
Richard Smith
2024-06-06 15:12:48 +00:00
committed by GitHub
parent 9a11e977b3
commit 1c07f959a8
520 changed files with 12043 additions and 12040 deletions
@@ -25,7 +25,7 @@ fn A() {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %A: <type of A> = struct_value () [template]
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -34,14 +34,14 @@ fn A() {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A.decl: <type of A> = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref.loc16: <type of A> = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %A.ref.loc16: %A.type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %.loc16: ref <error> = deref <error>
// CHECK:STDOUT: %A.ref.loc20: <type of A> = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %A.ref.loc20: %A.type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %.loc20: ref <error> = deref <error>
// CHECK:STDOUT: return
// CHECK:STDOUT: }