mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 09:11:05 +01:00
Separate binding insts for refs and values (#6235)
This resolves a TODO in `expr_info.cpp` by using the inst kind rather than the bound value to track the binding's category. Since we're churning all the `bind_name` insts in testdata anyway, I'm also taking this opportunity to align the inst naming with the design's terminology, by calling these insts "bindings" (this aspect of the PR is dependent on #6231 resolving an ambiguity in that terminology). For consistency we'll need to rename several other insts as well (see the TODO on `RefBinding`); I'm deferring that to a separate PR to minimize the review load, but I think those name changes are in-scope for this review.
This commit is contained in:
@@ -749,7 +749,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %addr.loc8_24: %ptr.edf = addr_of %.loc8_14.3
|
||||
// CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_24)
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.cd8 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.cd8 = ref_binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.cd8 = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %S = var %x.var_patt
|
||||
@@ -758,7 +758,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %N.ref.loc10: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
|
||||
// CHECK:STDOUT: %S.ref.loc10: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %S = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %x: ref %S = ref_binding x, %x.var
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %x.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.906
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %x.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
|
||||
@@ -896,7 +896,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %addr.loc8_24: %ptr.149 = addr_of %.loc8_14.3
|
||||
// CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_24)
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.cff = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.cff = ref_binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.cff = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %O = var %x.var_patt
|
||||
@@ -904,7 +904,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %O.ref.loc9: type = name_ref O, imports.%O.decl [concrete = constants.%O]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %O = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %x: ref %O = ref_binding x, %x.var
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %x.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.981
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %x.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
|
||||
|
||||
Reference in New Issue
Block a user