mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 21:06:41 +00: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:
1 parent
af04d08965
commit
e7626f46cc
10 files changed
+40
-58
No files matched your search
@@ -45,11 +45,11 @@ auto AddReturnPatterns(Context& context, SemIR::LocId loc_id,
|
||||
case CARBON_KIND(SemIR::InitForm _): {
|
||||
auto pattern_type_id =
|
||||
GetPatternType(context, form_expr.type_component_id);
|
||||
auto out_param_id = AddPatternInst<SemIR::OutParamPattern>(
|
||||
auto out_param_id = AddInst<SemIR::OutParamPattern>(
|
||||
context, SemIR::LocId(form_expr.form_inst_id),
|
||||
{.type_id = pattern_type_id,
|
||||
.pretty_name_id = SemIR::NameId::ReturnSlot});
|
||||
return_patterns.push_back(AddPatternInst<SemIR::ReturnSlotPattern>(
|
||||
return_patterns.push_back(AddInst<SemIR::ReturnSlotPattern>(
|
||||
context, SemIR::LocId(form_expr.form_inst_id),
|
||||
{.type_id = pattern_type_id,
|
||||
.subpattern_id = out_param_id,
|
||||
|
||||
Reference in new issue
Block a user