Model type expressions as regions (#4698)

This is a precondition for enabling the new pattern-matching subsystem
to support binding patterns that have `if` expressions in the type
position.

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Geoff Romer
2024-12-19 21:41:06 +00:00
committed by GitHub
co-authored by Richard Smith
parent 95c9634c60
commit a112cbde5c
504 changed files with 5699 additions and 8719 deletions
+9 -7
View File
@@ -47,17 +47,19 @@ fn F(p: const (const (const i32*)*)) -> const i32 {
// CHECK:STDOUT: %return.patt: %const.1 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %const.1 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %const.loc12_23: type = const_type %i32 [template = constants.%const.1]
// CHECK:STDOUT: %ptr.loc12_32: type = ptr_type %const.1 [template = constants.%ptr.1]
// CHECK:STDOUT: %const.loc12_16: type = const_type %ptr.1 [template = constants.%const.2]
// CHECK:STDOUT: %ptr.loc12_34: type = ptr_type %const.2 [template = constants.%ptr.2]
// CHECK:STDOUT: %const.loc12_9: type = const_type %ptr.2 [template = constants.%const.3]
// CHECK:STDOUT: %int_32.loc12_47: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %const.loc12_41: type = const_type %i32 [template = constants.%const.1]
// CHECK:STDOUT: %p.param: %const.3 = value_param runtime_param0
// CHECK:STDOUT: %.loc12: type = splice_block %const.loc12_9 [template = constants.%const.3] {
// CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %const.loc12_23: type = const_type %i32 [template = constants.%const.1]
// CHECK:STDOUT: %ptr.loc12_32: type = ptr_type %const.1 [template = constants.%ptr.1]
// CHECK:STDOUT: %const.loc12_16: type = const_type %ptr.1 [template = constants.%const.2]
// CHECK:STDOUT: %ptr.loc12_34: type = ptr_type %const.2 [template = constants.%ptr.2]
// CHECK:STDOUT: %const.loc12_9: type = const_type %ptr.2 [template = constants.%const.3]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: %const.3 = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %const.1 = out_param runtime_param1
// CHECK:STDOUT: %return: ref %const.1 = return_slot %return.param