Remove index fields from ParamPatterns (#6815)

This is a step toward removing the index from `InitForm`, so that equal
form values always have equal representations.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Geoff Romer
2026-03-03 00:19:47 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent 9ff6b0a682
commit 6dba8ee111
298 changed files with 1741 additions and 1747 deletions
+7 -6
View File
@@ -165,15 +165,16 @@ auto AddParamPattern(Context& context, SemIR::LocId loc_id,
const auto& param_pattern_kind =
is_ref ? SemIR::RefParamPattern::Kind : SemIR::ValueParamPattern::Kind;
// Allocate a dummy index to preserve index of subsequent `InitForm`s.
// TODO: Remove this once we remove `InitForm::index`.
context.full_pattern_stack().NextCallParamIndex();
pattern_id = AddPatternInst(
context,
SemIR::LocIdAndInst::UncheckedLoc(
loc_id,
SemIR::AnyParamPattern{
.kind = param_pattern_kind,
.type_id = context.insts().Get(pattern_id).type_id(),
.subpattern_id = pattern_id,
.index = context.full_pattern_stack().NextCallParamIndex()}));
loc_id, SemIR::AnyParamPattern{
.kind = param_pattern_kind,
.type_id = context.insts().Get(pattern_id).type_id(),
.subpattern_id = pattern_id}));
return pattern_id;
}