mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Model the return slot as an output parameter (#4432)
Also fix `Param` insts to have meaningful names in pretty-printing, to help clarify relationship with return slot.
This commit is contained in:
+7
-4
@@ -40,7 +40,7 @@ fn F(p: const (const (const i32*)*)) -> const i32 {
|
||||
// CHECK:STDOUT: import Core//prelude/operators/comparison
|
||||
// CHECK:STDOUT: import Core//prelude/types/bool
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+9, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -52,6 +52,8 @@ fn F(p: const (const (const i32*)*)) -> const i32 {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
|
||||
// CHECK:STDOUT: %p.patt: %.6 = binding_pattern p
|
||||
// CHECK:STDOUT: %p.param_patt: %.6 = param_pattern %p.patt, runtime_param0
|
||||
// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: %.2 = param_pattern %return.patt, runtime_param1
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc12_29: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_32.loc12_29 [template = i32]
|
||||
@@ -65,9 +67,10 @@ fn F(p: const (const (const i32*)*)) -> const i32 {
|
||||
// CHECK:STDOUT: %.loc12_41.1: type = value_of_initializer %int.make_type_32.loc12_47 [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_41.2: type = converted %int.make_type_32.loc12_47, %.loc12_41.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_41.3: type = const_type i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %return: ref %.2 = var <return slot>
|
||||
// CHECK:STDOUT: %param: %.6 = param runtime_param0
|
||||
// CHECK:STDOUT: %p: %.6 = bind_name p, %param
|
||||
// CHECK:STDOUT: %p.param: %.6 = param runtime_param0
|
||||
// CHECK:STDOUT: %p: %.6 = bind_name p, %p.param
|
||||
// CHECK:STDOUT: %return.param: %.2 = param runtime_param1
|
||||
// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user