mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -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: }
|
||||
|
||||
Reference in New Issue
Block a user