mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 13:31:06 +01:00
Get rid of AddPatternInst (#7075)
Instead, use the inst category to select the right block stack. This simplifies the API for adding insts, and in subsequent changes it will enable certain inst kinds like `SpliceInst` to seamlessly function as either procedural insts or pattern insts.
This commit is contained in:
@@ -297,17 +297,17 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
auto pattern_type_id =
|
||||
GetPatternType(context, type_expr.type_component_id);
|
||||
if (is_ref) {
|
||||
param_pattern_id = AddPatternInst<SemIR::RefParamPattern>(
|
||||
param_pattern_id = AddInst<SemIR::RefParamPattern>(
|
||||
context, node_id,
|
||||
{.type_id = pattern_type_id, .pretty_name_id = name_id});
|
||||
} else if (node_kind == Parse::NodeKind::FormBindingPattern) {
|
||||
param_pattern_id = AddPatternInst<SemIR::FormParamPattern>(
|
||||
context, node_id,
|
||||
{.type_id = pattern_type_id,
|
||||
.pretty_name_id = name_id,
|
||||
.form_id = form_id});
|
||||
param_pattern_id =
|
||||
AddInst<SemIR::FormParamPattern>(context, node_id,
|
||||
{.type_id = pattern_type_id,
|
||||
.pretty_name_id = name_id,
|
||||
.form_id = form_id});
|
||||
} else {
|
||||
param_pattern_id = AddPatternInst<SemIR::ValueParamPattern>(
|
||||
param_pattern_id = AddInst<SemIR::ValueParamPattern>(
|
||||
context, node_id,
|
||||
{.type_id = pattern_type_id, .pretty_name_id = name_id});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user