mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Distinguish between name IDs and string IDs in the type system. (#3341)
Add a `NameId` that is effectively just a wrapper around a `StringId`, with some additional predefined values for names that don't correspond to strings, such as the name of `self` or the function's return slot.
This commit is contained in:
+3
-3
@@ -24,8 +24,8 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%arr: [i32; 3], %i: i32) -> i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %arr.ref: [i32; 3] = name_reference "arr", %arr
|
||||
// CHECK:STDOUT: %i.ref: i32 = name_reference "i", %i
|
||||
// CHECK:STDOUT: %arr.ref: [i32; 3] = name_reference arr, %arr
|
||||
// CHECK:STDOUT: %i.ref: i32 = name_reference i, %i
|
||||
// CHECK:STDOUT: %.loc8_15.1: ref [i32; 3] = value_as_reference %arr.ref
|
||||
// CHECK:STDOUT: %.loc8_15.2: ref i32 = array_index %.loc8_15.1, %i.ref
|
||||
// CHECK:STDOUT: %.loc8_15.3: i32 = bind_value %.loc8_15.2
|
||||
@@ -34,7 +34,7 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() -> i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: <function> = name_reference "F", file.%F
|
||||
// CHECK:STDOUT: %F.ref: <function> = name_reference F, file.%F
|
||||
// CHECK:STDOUT: %.loc12_13: i32 = int_literal 1
|
||||
// CHECK:STDOUT: %.loc12_16: i32 = int_literal 2
|
||||
// CHECK:STDOUT: %.loc12_19: i32 = int_literal 3
|
||||
|
||||
Reference in New Issue
Block a user