mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +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:
@@ -99,9 +99,6 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type = value_binding_pattern a [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8_28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Enum.ref.loc8_31: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum]
|
||||
// CHECK:STDOUT: %a.ref: %Enum = name_ref a, imports.%int_0 [concrete = constants.%int_0]
|
||||
@@ -111,7 +108,7 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: %Enum = wrapper_binding a, %a.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type = value_binding_pattern b [concrete = constants.%b.patt]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type = value_binding_pattern a [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc9_28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %b.ref: %Enum = name_ref b, imports.%int_1 [concrete = constants.%int_1]
|
||||
@@ -120,6 +117,9 @@ fn F() {
|
||||
// CHECK:STDOUT: %Enum.ref.loc9: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: %Enum = wrapper_binding b, %b.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type = value_binding_pattern b [concrete = constants.%b.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user