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:
Geoff Romer
2026-03-06 17:35:48 +00:00
committed by GitHub
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
211 changed files with 1729 additions and 1703 deletions
@@ -93,7 +93,7 @@ fn StarstWith(a: str, b: str) -> bool {
// CHECK:STDOUT: %ptr.85f: type = ptr_type %str.ee0 [concrete]
// CHECK:STDOUT: %Consume__carbon_thunk.type: type = fn_type @Consume__carbon_thunk [concrete]
// CHECK:STDOUT: %Consume__carbon_thunk: %Consume__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %.2ff: Core.Form = init_form %str.ee0, call_param0 [concrete]
// CHECK:STDOUT: %.b6b: Core.Form = init_form %str.ee0 [concrete]
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
// CHECK:STDOUT: %Produce.cpp_overload_set.type: type = cpp_overload_set_type @Produce.cpp_overload_set [concrete]
@@ -129,7 +129,7 @@ fn StarstWith(a: str, b: str) -> bool {
// CHECK:STDOUT: %return.param_patt: %pattern_type.461 = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %str: type = type_literal constants.%str.ee0 [concrete = constants.%str.ee0]
// CHECK:STDOUT: %.loc13_11.2: Core.Form = init_form %str, call_param0 [concrete = constants.%.2ff]
// CHECK:STDOUT: %.loc13_11.2: Core.Form = init_form %str [concrete = constants.%.b6b]
// CHECK:STDOUT: %return.param: ref %str.ee0 = out_param call_param0
// CHECK:STDOUT: %return: ref %str.ee0 = return_slot %return.param
// CHECK:STDOUT: }
@@ -165,7 +165,7 @@ fn StarstWith(a: str, b: str) -> bool {
// CHECK:STDOUT: %str: type = class_type @String [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %pattern_type.461: type = pattern_type %str [concrete]
// CHECK:STDOUT: %.d29: Core.Form = init_form bool, call_param2 [concrete]
// CHECK:STDOUT: %.f34: Core.Form = init_form bool [concrete]
// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
// CHECK:STDOUT: %StarstWith.type: type = fn_type @StarstWith [concrete]
// CHECK:STDOUT: %StarstWith: %StarstWith.type = struct_value () [concrete]
@@ -202,7 +202,7 @@ fn StarstWith(a: str, b: str) -> bool {
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc7_34.1: type = type_literal bool [concrete = bool]
// CHECK:STDOUT: %.loc7_34.2: Core.Form = init_form %.loc7_34.1, call_param2 [concrete = constants.%.d29]
// CHECK:STDOUT: %.loc7_34.2: Core.Form = init_form %.loc7_34.1 [concrete = constants.%.f34]
// CHECK:STDOUT: %a.param: %str = value_param call_param0
// CHECK:STDOUT: %str.loc7_18: type = type_literal constants.%str [concrete = constants.%str]
// CHECK:STDOUT: %a: %str = value_binding a, %a.param