Replace GetCurrentReturnSlot with GetReturnedVarParam (#6571)

Not all functions have a return slot, and once we have composite forms,
functions will be able to have any number of return slots. Obtaining a
unique return slot for a function only makes sense in `returned var`
handling.
This commit is contained in:
Geoff Romer
2026-01-10 01:56:32 +00:00
committed by GitHub
parent 3c70a9f59b
commit 6985ecb1d4
219 changed files with 1097 additions and 1089 deletions
+2 -2
View File
@@ -106,7 +106,7 @@ fn F() -> array(i32, 1) {
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_15.2(%.loc6_15.2)
// CHECK:STDOUT: %DestroyOp.bound: <bound method> = bound_method %.loc6_12.2, constants.%DestroyOp
// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc6_12.2)
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call to %return
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @DestroyOp(%self.param: %array_type) = "no_op";
@@ -132,6 +132,6 @@ fn F() -> array(i32, 1) {
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
// CHECK:STDOUT: %val.ref: <error> = name_ref val, <error> [concrete = <error>]
// CHECK:STDOUT: return <error> to %return
// CHECK:STDOUT: return <error> to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4 -4
View File
@@ -118,7 +118,7 @@ fn F(a: array({}, 3)) -> {} {
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
// CHECK:STDOUT: %bound_method.loc4_15.2: <bound method> = bound_method %.loc4_15.3, %specific_fn
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc4_15.2(%.loc4_15.3)
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call to %return
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() -> %i32 {
@@ -171,7 +171,7 @@ fn F(a: array({}, 3)) -> {} {
// CHECK:STDOUT: %F.call: init %i32 = call %F.ref(%.loc10_20.15, %.loc10_23.2)
// CHECK:STDOUT: %DestroyOp.bound: <bound method> = bound_method %.loc10_20.14, constants.%DestroyOp
// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc10_20.14)
// CHECK:STDOUT: return %F.call to %return
// CHECK:STDOUT: return %F.call to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @DestroyOp(%self.param: %array_type) = "no_op";
@@ -230,8 +230,8 @@ fn F(a: array({}, 3)) -> {} {
// CHECK:STDOUT: %.loc6_30.2: ref %empty_struct_type = array_index %.loc6_30.1, %.loc6_24.3
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc6_30.3: %empty_struct_type = converted %.loc6_30.2, %empty_struct [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc6_30.4: init %empty_struct_type = struct_init () to %return [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc6_30.4: init %empty_struct_type = struct_init () to %return.param [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc6_31: init %empty_struct_type = converted %.loc6_30.3, %.loc6_30.4 [concrete = constants.%empty_struct]
// CHECK:STDOUT: return %.loc6_31 to %return
// CHECK:STDOUT: return %.loc6_31 to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: