Change Namespace formatting to use the scope's name. (#3782)

This change only affects the generated IR, but I think it's cleaning up
an existing issue with namespace name printing.
This commit is contained in:
Jon Ross-Perkins
2024-03-14 21:12:26 +00:00
committed by GitHub
parent 28d76e6164
commit 295c8eb97f
24 changed files with 136 additions and 129 deletions
@@ -28,10 +28,10 @@ fn F() -> bool {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .NS = %.loc7
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc7: <namespace> = namespace [template] {}
// CHECK:STDOUT: %NS: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %return.var: ref bool = var <return slot>
// CHECK:STDOUT: }
@@ -41,7 +41,7 @@ fn F() -> bool {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc16_16: bool = bool_literal false [template = constants.%.1]
// CHECK:STDOUT: %.loc16_9: <error> = bind_alias <invalid>, <error> [template = <error>]
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%.loc7 [template = file.%.loc7]
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
// CHECK:STDOUT: %a.ref: <error> = name_ref a, <error> [template = <error>]
// CHECK:STDOUT: return <error>
// CHECK:STDOUT: }
+4 -4
View File
@@ -21,19 +21,19 @@ fn F() -> NS.a {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .NS = %.loc7
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc7: <namespace> = namespace [template] {
// CHECK:STDOUT: %NS: <namespace> = namespace [template] {
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %a: type = bind_alias a, bool [template = bool]
// CHECK:STDOUT: %NS.ref.loc10: <namespace> = name_ref NS, %.loc7 [template = %.loc7]
// CHECK:STDOUT: %NS.ref.loc10: <namespace> = name_ref NS, %NS [template = %NS]
// CHECK:STDOUT: %a.ref.loc10: type = name_ref a, %a [template = bool]
// CHECK:STDOUT: %.loc10: bool = bool_literal false [template = constants.%.1]
// CHECK:STDOUT: %b: bool = bind_name b, %.loc10
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %NS.ref.loc12: <namespace> = name_ref NS, %.loc7 [template = %.loc7]
// CHECK:STDOUT: %NS.ref.loc12: <namespace> = name_ref NS, %NS [template = %NS]
// CHECK:STDOUT: %a.ref.loc12: type = name_ref a, %a [template = bool]
// CHECK:STDOUT: %return.var: ref bool = var <return slot>
// CHECK:STDOUT: }