mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
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:
co-authored by
Jon Ross-Perkins
parent
9ff6b0a682
commit
6dba8ee111
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user