mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:50:14 +01:00
Remove InitForm::index (#6817)
This ensures that equal forms always have equal representations (because the index depends on how the form is used, not on the value of the form itself). As a byproduct, also remove `NextCallParamIndex`. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nicholas Bishop <nicholasbishop@google.com> Co-authored-by: Jon Ross-Perkins <jperkins@google.com> Co-authored-by: Dana Jansens <danakj@orodu.net> Co-authored-by: Boaz Brickner <brickner@google.com> Co-authored-by: Richard Smith <richard@metafoo.co.uk> Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com> Co-authored-by: MK4070 <60286678+MK4070@users.noreply.github.com> Co-authored-by: Christopher Di Bella <cjdb@google.com>
This commit is contained in:
co-authored by
dependabot[bot]
Nicholas Bishop
Jon Ross-Perkins
Dana Jansens
Boaz Brickner
Richard Smith
Carbon Infra Bot
MK4070
Christopher Di Bella
parent
2327b62b5f
commit
21291b4cc3
@@ -46,7 +46,6 @@ class FullPatternStack {
|
||||
auto PushFullPattern(Kind kind) -> void {
|
||||
kind_stack_.push_back(kind);
|
||||
bind_name_stack_.PushArray();
|
||||
param_index_stack_.push_back(SemIR::CallParamIndex(0));
|
||||
}
|
||||
|
||||
// Marks the end of an implicit parameter list, and the presumptive start
|
||||
@@ -88,7 +87,6 @@ class FullPatternStack {
|
||||
auto PopFullPattern() -> void {
|
||||
kind_stack_.pop_back();
|
||||
bind_name_stack_.PopArray();
|
||||
param_index_stack_.pop_back();
|
||||
}
|
||||
|
||||
// Records that `name_id` was introduced by the current full-pattern.
|
||||
@@ -104,13 +102,6 @@ class FullPatternStack {
|
||||
kind_stack_.size());
|
||||
}
|
||||
|
||||
// Allocates the next unallocated CallParamIndex, starting from 0.
|
||||
auto NextCallParamIndex() -> SemIR::CallParamIndex {
|
||||
auto result = param_index_stack_.back();
|
||||
++param_index_stack_.back().index;
|
||||
return result;
|
||||
}
|
||||
|
||||
private:
|
||||
LexicalLookup* lookup_;
|
||||
|
||||
@@ -121,8 +112,6 @@ class FullPatternStack {
|
||||
SemIR::InstId inst_id;
|
||||
};
|
||||
ArrayStack<LookupEntry> bind_name_stack_;
|
||||
|
||||
llvm::SmallVector<SemIR::CallParamIndex> param_index_stack_;
|
||||
};
|
||||
|
||||
} // namespace Carbon::Check
|
||||
|
||||
Reference in New Issue
Block a user