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
-3
@@ -52,7 +52,7 @@ fn While() {
|
||||
// CHECK:STDOUT: import Core//prelude/operators/comparison
|
||||
// CHECK:STDOUT: import Core//prelude/types/bool
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool]
|
||||
// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+5, loaded [template = constants.%Bool]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -65,11 +65,15 @@ fn While() {
|
||||
// CHECK:STDOUT: .While = %While.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Cond.decl: %Cond.type = fn_decl @Cond [template = constants.%Cond] {} {
|
||||
// CHECK:STDOUT: %Cond.decl: %Cond.type = fn_decl @Cond [template = constants.%Cond] {
|
||||
// CHECK:STDOUT: %return.patt: bool = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: bool = param_pattern %return.patt, runtime_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
|
||||
// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %bool.make_type [template = bool]
|
||||
// CHECK:STDOUT: %.loc11_14.2: type = converted %bool.make_type, %.loc11_14.1 [template = bool]
|
||||
// CHECK:STDOUT: %return: ref bool = var <return slot>
|
||||
// CHECK:STDOUT: %return.param: bool = param runtime_param0
|
||||
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {}
|
||||
|
||||
Reference in New Issue
Block a user