mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Model patterns as constant values (#5385)
This will enable us to simplify support for parameter and return patterns in import, which operates primarily on constants.
This commit is contained in:
+10
-10
@@ -61,14 +61,14 @@ fn F(b: bool, n: i32, m: i32) -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.831 = binding_pattern b
|
||||
// CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern %b.patt, call_param0
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.7ce = binding_pattern n
|
||||
// CHECK:STDOUT: %n.param_patt: %pattern_type.7ce = value_param_pattern %n.patt, call_param1
|
||||
// CHECK:STDOUT: %m.patt: %pattern_type.7ce = binding_pattern m
|
||||
// CHECK:STDOUT: %m.param_patt: %pattern_type.7ce = value_param_pattern %m.patt, call_param2
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param3
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.831 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern %b.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.7ce = binding_pattern n [concrete]
|
||||
// CHECK:STDOUT: %n.param_patt: %pattern_type.7ce = value_param_pattern %n.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: %m.patt: %pattern_type.7ce = binding_pattern m [concrete]
|
||||
// CHECK:STDOUT: %m.param_patt: %pattern_type.7ce = value_param_pattern %m.patt, call_param2 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param3 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int_32.loc11_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
@@ -99,8 +99,8 @@ fn F(b: bool, n: i32, m: i32) -> i32 {
|
||||
// CHECK:STDOUT: fn @F(%b.param: bool, %n.param: %i32, %m.param: %i32) -> %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.a98 = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc12_3.1: %pattern_type.a98 = var_pattern %x.patt
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.a98 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %.loc12_3.1: %pattern_type.a98 = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %array_type = var x
|
||||
// CHECK:STDOUT: %int_0.loc12_27: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
|
||||
Reference in New Issue
Block a user