Separate inst kind for out params (#4442)

This commit is contained in:
Geoff Romer
2024-10-24 15:22:32 +00:00
committed by GitHub
parent 06f4eec91e
commit b67d03126e
345 changed files with 4128 additions and 4019 deletions
+1 -3
View File
@@ -46,9 +46,7 @@ auto HandleParseNode(Context& context, Parse::ReturnTypeId node_id) -> bool {
auto type_id = ExprAsType(context, type_node_id, type_inst_id).type_id;
auto return_slot_id = context.AddPatternInst<SemIR::ReturnSlotPattern>(
node_id, {.type_id = type_id, .type_inst_id = type_inst_id});
// TODO: Use a separate inst kind here and for the corresponding Param,
// to capture the fact that the corresponding Param is not a value expression.
auto param_pattern_id = context.AddPatternInst<SemIR::ParamPattern>(
auto param_pattern_id = context.AddPatternInst<SemIR::OutParamPattern>(
node_id, {.type_id = type_id,
.subpattern_id = return_slot_id,
.runtime_index = SemIR::RuntimeParamIndex::Unknown});