mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 02:18:12 +00: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:
1 parent
08051393dc
commit
b72bfb918b
10 files changed
+41
-38
No files matched your search
@@ -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