Refactor function return type representation (#6463)

This separates the return type from the return pattern, and replaces the
return pattern with a block of return patterns. This is a step toward
support for `ref` returns (where there's no corresponding return
pattern) and compund-form returns (where there may be multiple return
patterns).
This commit is contained in:
Geoff Romer
2025-12-10 18:34:23 +00:00
committed by GitHub
parent 77918d023b
commit bf45b1cbf5
57 changed files with 1668 additions and 1532 deletions
+2 -2
View File
@@ -1811,7 +1811,7 @@ auto ConvertCallArgs(Context& context, SemIR::LocId call_loc_id,
-> SemIR::InstBlockId {
auto param_patterns =
context.inst_blocks().GetOrEmpty(callee.param_patterns_id);
auto return_slot_pattern_id = callee.return_slot_pattern_id;
auto return_patterns_id = callee.return_patterns_id;
// The caller should have ensured this callee has the right arity.
CARBON_CHECK(arg_refs.size() == param_patterns.size());
@@ -1828,7 +1828,7 @@ auto ConvertCallArgs(Context& context, SemIR::LocId call_loc_id,
}
return CallerPatternMatch(context, callee_specific_id, callee.self_param_id,
callee.param_patterns_id, return_slot_pattern_id,
callee.param_patterns_id, return_patterns_id,
self_id, arg_refs, return_slot_arg_id);
}