mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:44: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:
+14
-14
@@ -107,8 +107,8 @@ var arr: array(i32, (1 as i32).(I.F)(2));
|
||||
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.a9a.%F.decl), @impl.a9a [concrete]
|
||||
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %arr.patt: %pattern_type.5d8 = binding_pattern arr
|
||||
// CHECK:STDOUT: %.loc19_1: %pattern_type.5d8 = var_pattern %arr.patt
|
||||
// CHECK:STDOUT: %arr.patt: %pattern_type.5d8 = binding_pattern arr [concrete]
|
||||
// CHECK:STDOUT: %.loc19_1: %pattern_type.5d8 = var_pattern %arr.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr.var: ref %array_type = var arr
|
||||
// CHECK:STDOUT: %.loc19_40: type = splice_block %array_type [concrete = constants.%array_type] {
|
||||
@@ -154,12 +154,12 @@ var arr: array(i32, (1 as i32).(I.F)(2));
|
||||
// CHECK:STDOUT: interface @I {
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
|
||||
// CHECK:STDOUT: %F.decl: %F.type.cf0 = fn_decl @F.1 [concrete = constants.%F.bc6] {
|
||||
// CHECK:STDOUT: %self.patt: @F.1.%pattern_type (%pattern_type.6de) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type (%pattern_type.6de) = value_param_pattern %self.patt, call_param0
|
||||
// CHECK:STDOUT: %other.patt: @F.1.%pattern_type (%pattern_type.6de) = binding_pattern other
|
||||
// CHECK:STDOUT: %other.param_patt: @F.1.%pattern_type (%pattern_type.6de) = value_param_pattern %other.patt, call_param1
|
||||
// CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.6de) = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.6de) = out_param_pattern %return.patt, call_param2
|
||||
// CHECK:STDOUT: %self.patt: @F.1.%pattern_type (%pattern_type.6de) = binding_pattern self [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type (%pattern_type.6de) = value_param_pattern %self.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %other.patt: @F.1.%pattern_type (%pattern_type.6de) = binding_pattern other [concrete]
|
||||
// CHECK:STDOUT: %other.param_patt: @F.1.%pattern_type (%pattern_type.6de) = value_param_pattern %other.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.6de) = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.6de) = out_param_pattern %return.patt, call_param2 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref.loc12_36: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.826)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc12_36: type = facet_access_type %Self.ref.loc12_36 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.b70)]
|
||||
@@ -191,12 +191,12 @@ var arr: array(i32, (1 as i32).(I.F)(2));
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl.a9a: %i32 as %I.ref {
|
||||
// CHECK:STDOUT: %F.decl: %F.type.066 = fn_decl @F.2 [concrete = constants.%F.9ec] {
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.7ce = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.7ce = value_param_pattern %self.patt, call_param0
|
||||
// CHECK:STDOUT: %other.patt: %pattern_type.7ce = binding_pattern other
|
||||
// CHECK:STDOUT: %other.param_patt: %pattern_type.7ce = value_param_pattern %other.patt, call_param1
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.7ce = binding_pattern self [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.7ce = value_param_pattern %self.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %other.patt: %pattern_type.7ce = binding_pattern other [concrete]
|
||||
// CHECK:STDOUT: %other.param_patt: %pattern_type.7ce = value_param_pattern %other.patt, call_param1 [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_param2 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int_32.loc16_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc16_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
|
||||
Reference in New Issue
Block a user