mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 08:18:16 +00:00
Give files shorthand names in textual SemIR (#8104)
Shorthand names are intended to be used in the textual format of references to instructions in another IR (which can't happen now, but will be possible in a forthcoming PR). The shorthand name uses the file name (minus the `.carbon` suffix) as a base, and if that base name is ambiguous within the compilation, it is given a numerical suffix `.N`, just like other textual IR names. Shorthand names are prefixed with `$` in the textual format, to distinguish them from inst and scope names. For example, a file `foo/bar.carbon` has the shorthand name `$bar`, and an instruction `@baz.%qux` in that file can be referenced from another file as `$bar.@baz.%qux`. This PR adds `toolchain/check/testdata/basics/file_name.carbon` to test this behavior. All other test changes are just applying this change to the existing textual SemIR dumps. --------- Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
1 parent
54728e47fe
commit
e67b6db910
790 files changed
+2398
-2479
No files matched your search
@@ -37,7 +37,7 @@ fn G() {
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// CHECK:STDOUT: --- copy_enum.carbon
|
||||
// CHECK:STDOUT: --- copy_enum.carbon = $copy_enum
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
|
||||
@@ -97,7 +97,7 @@ fn F() {
|
||||
Cpp.a as Cpp.DifferentSize;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- convert_enum.carbon
|
||||
// CHECK:STDOUT: --- convert_enum.carbon = $convert_enum
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ fn F() {
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// CHECK:STDOUT: --- copy_enum.carbon
|
||||
// CHECK:STDOUT: --- copy_enum.carbon = $copy_enum
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ fn F() {
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// CHECK:STDOUT: --- import_enum.carbon
|
||||
// CHECK:STDOUT: --- import_enum.carbon = $import_enum
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
|
||||
@@ -69,7 +69,7 @@ fn MyF() {
|
||||
var unused e: Cpp.UnsizedEnum;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- import_declaration.carbon
|
||||
// CHECK:STDOUT: --- import_declaration.carbon = $import_declaration
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ fn F() {
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// CHECK:STDOUT: --- import_enum_member.carbon
|
||||
// CHECK:STDOUT: --- import_enum_member.carbon = $import_enum_member
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ fn F() {
|
||||
let unused b: Cpp.Enum = Cpp.b;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- import_enum.carbon
|
||||
// CHECK:STDOUT: --- import_enum.carbon = $import_enum
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
|
||||
@@ -80,7 +80,7 @@ fn F() {
|
||||
let unused c: Cpp.Other = Cpp.Enum.d;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- import_enum.carbon
|
||||
// CHECK:STDOUT: --- import_enum.carbon = $import_enum
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ fn F() {
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// CHECK:STDOUT: --- import_enum.carbon
|
||||
// CHECK:STDOUT: --- import_enum.carbon = $import_enum
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
|
||||
Reference in new issue
Block a user