diff options
author | Alejandro Colomar <alx@kernel.org> | 2024-10-16 14:10:39 +0200 |
---|---|---|
committer | Joseph Myers <josmyers@redhat.com> | 2024-10-18 22:39:20 +0000 |
commit | 11577659949dfd1dfb49cc14e6dcc6b394ebd8c4 (patch) | |
tree | 3041b6164fe7685189be705dcb948783a4532c71 /gcc/expr.cc | |
parent | f8687bceaa8ef9cd3c48b6706e8620af3ec5e2eb (diff) | |
download | gcc-11577659949dfd1dfb49cc14e6dcc6b394ebd8c4.zip gcc-11577659949dfd1dfb49cc14e6dcc6b394ebd8c4.tar.gz gcc-11577659949dfd1dfb49cc14e6dcc6b394ebd8c4.tar.bz2 |
gcc/: Rename array_type_nelts => array_type_nelts_minus_one
The old name was misleading.
While at it, also rename some temporary variables that are used with
this function, for consistency.
Link: <https://inbox.sourceware.org/gcc-patches/9fffd80-dca-2c7e-14b-6c9b509a7215@redhat.com/T/#m2f661c67c8f7b2c405c8c7fc3152dd85dc729120>
gcc/ChangeLog:
* tree.cc (array_type_nelts, array_type_nelts_minus_one)
* tree.h (array_type_nelts, array_type_nelts_minus_one)
* expr.cc (count_type_elements)
* config/aarch64/aarch64.cc
(pure_scalable_type_info::analyze_array)
* config/i386/i386.cc (ix86_canonical_va_list_type):
Rename array_type_nelts => array_type_nelts_minus_one
The old name was misleading.
gcc/c/ChangeLog:
* c-decl.cc (one_element_array_type_p, get_parm_array_spec)
* c-fold.cc (c_fold_array_ref):
Rename array_type_nelts => array_type_nelts_minus_one
gcc/cp/ChangeLog:
* decl.cc (reshape_init_array)
* init.cc
(build_zero_init_1)
(build_value_init_noctor)
(build_vec_init)
(build_delete)
* lambda.cc (add_capture)
* tree.cc (array_type_nelts_top):
Rename array_type_nelts => array_type_nelts_minus_one
gcc/fortran/ChangeLog:
* trans-array.cc (structure_alloc_comps)
* trans-openmp.cc
(gfc_walk_alloc_comps)
(gfc_omp_clause_linear_ctor):
Rename array_type_nelts => array_type_nelts_minus_one
gcc/rust/ChangeLog:
* backend/rust-tree.cc (array_type_nelts_top):
Rename array_type_nelts => array_type_nelts_minus_one
Suggested-by: Richard Biener <richard.guenther@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'gcc/expr.cc')
-rw-r--r-- | gcc/expr.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/expr.cc b/gcc/expr.cc index b7a04f7..87f9e00 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -6991,14 +6991,14 @@ count_type_elements (const_tree type, bool for_ctor_p) { case ARRAY_TYPE: { - tree nelts; + tree nelts_minus_one; - nelts = array_type_nelts (type); - if (nelts && tree_fits_uhwi_p (nelts)) + nelts_minus_one = array_type_nelts_minus_one (type); + if (nelts_minus_one && tree_fits_uhwi_p (nelts_minus_one)) { unsigned HOST_WIDE_INT n; - n = tree_to_uhwi (nelts) + 1; + n = tree_to_uhwi (nelts_minus_one) + 1; if (n == 0 || for_ctor_p) return n; else |