mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Allocate CallParamIndexes eagerly (#6540)
This approach is more robust because there's no intermediate state where the `ParamPattern` insts have been created, but don't yet have their final values.
This commit is contained in:
@@ -237,13 +237,13 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
context, node_id,
|
||||
{.type_id = type_id,
|
||||
.subpattern_id = result_inst_id,
|
||||
.index = SemIR::CallParamIndex::None});
|
||||
.index = context.full_pattern_stack().NextCallParamIndex()});
|
||||
} else {
|
||||
result_inst_id = AddPatternInst<SemIR::ValueParamPattern>(
|
||||
context, node_id,
|
||||
{.type_id = type_id,
|
||||
.subpattern_id = result_inst_id,
|
||||
.index = SemIR::CallParamIndex::None});
|
||||
.index = context.full_pattern_stack().NextCallParamIndex()});
|
||||
}
|
||||
}
|
||||
context.node_stack().Push(node_id, result_inst_id);
|
||||
|
||||
Reference in New Issue
Block a user