mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:34:43 +01:00
Emit NameBindingDecl after the initializer (if any) (#7467)
In some cases the pattern block can depend on the initializer, so it must be sequenced after it. See #7469 for a more detailed explanation of why this is necessary.
This commit is contained in:
+4
-4
@@ -82,10 +82,6 @@ fn Main() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Main() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.cb1 = ref_binding_pattern b [concrete = constants.%b.patt]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.cb1 = var_pattern %b.patt [concrete = constants.%b.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %empty_tuple.type = var_storage %b.var_patt
|
||||
// CHECK:STDOUT: %B.ref: %A.type = name_ref B, file.%B [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %A.call: init %empty_tuple.type = call %B.ref()
|
||||
@@ -95,6 +91,10 @@ fn Main() {
|
||||
// CHECK:STDOUT: %.loc20_18.3: type = converted %.loc20_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %empty_tuple.type = wrapper_binding b, %b.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.cb1 = ref_binding_pattern b [concrete = constants.%b.patt]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.cb1 = var_pattern %b.patt [concrete = constants.%b.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %b.var, constants.%Destroy.Op
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%b.var)
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
Reference in New Issue
Block a user