mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:14:42 +01:00
Add a Field node for fields in a class. (#3332)
This replaces the use of `VarStorage` in this case. Add an `UnboundFieldType` type as the type of a field, in cases where it's referenced without an accompanying object. Add a `BindName` node to describe the name binding performed for both variables and fields so that we can handle them more uniformly.
This commit is contained in:
+3
-1
@@ -32,7 +32,9 @@ fn Run() -> i32 {
|
||||
// CHECK:STDOUT: class @Class {
|
||||
// CHECK:STDOUT: %F: <function> = fn_decl @F
|
||||
// CHECK:STDOUT: %G: <function> = fn_decl @G
|
||||
// CHECK:STDOUT: %k: ref i32 = var "k"
|
||||
// CHECK:STDOUT: %.loc14_8.1: type = unbound_field_type Class, i32
|
||||
// CHECK:STDOUT: %.loc14_8.2: <unbound field of class Class> = field "k"
|
||||
// CHECK:STDOUT: %k: <unbound field of class Class> = bind_name "k", %.loc14_8.2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .F = %F
|
||||
|
||||
Reference in New Issue
Block a user