aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-10-16 14:10:48 +0200
committerJoseph Myers <josmyers@redhat.com>2024-10-18 22:42:16 +0000
commitc886eb3421883a3ab70c6af79f271289cc8bb1d4 (patch)
treed0e93e63d021cfb339bceb971cca401f9d2ec52c /gcc/cp
parent11577659949dfd1dfb49cc14e6dcc6b394ebd8c4 (diff)
downloadgcc-c886eb3421883a3ab70c6af79f271289cc8bb1d4.zip
gcc-c886eb3421883a3ab70c6af79f271289cc8bb1d4.tar.gz
gcc-c886eb3421883a3ab70c6af79f271289cc8bb1d4.tar.bz2
gcc/: Merge definitions of array_type_nelts_top
There were two identical definitions, and none of them are available where they are needed for implementing a number-of-elements-of operator. Merge them, and provide the single definition in gcc/tree.{h,cc}, where it's available for that operator, which will be added in a following commit. gcc/ChangeLog: * tree.h (array_type_nelts_top) * tree.cc (array_type_nelts_top): Define function (moved from gcc/cp/). gcc/cp/ChangeLog: * cp-tree.h (array_type_nelts_top) * tree.cc (array_type_nelts_top): Remove function (move to gcc/). gcc/rust/ChangeLog: * backend/rust-tree.h (array_type_nelts_top) * backend/rust-tree.cc (array_type_nelts_top): Remove function. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/tree.cc13
2 files changed, 0 insertions, 14 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 94ee550..a44100a 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -8121,7 +8121,6 @@ extern tree build_exception_variant (tree, tree);
extern void fixup_deferred_exception_variants (tree, tree);
extern tree bind_template_template_parm (tree, tree);
extern tree array_type_nelts_total (tree);
-extern tree array_type_nelts_top (tree);
extern bool array_of_unknown_bound_p (const_tree);
extern tree break_out_target_exprs (tree, bool = false);
extern tree build_ctor_subob_ref (tree, tree, tree);
diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc
index 3cac8ac..c80ee06 100644
--- a/gcc/cp/tree.cc
+++ b/gcc/cp/tree.cc
@@ -3077,19 +3077,6 @@ cxx_print_statistics (void)
}
/* Return, as an INTEGER_CST node, the number of elements for TYPE
- (which is an ARRAY_TYPE). This counts only elements of the top
- array. */
-
-tree
-array_type_nelts_top (tree type)
-{
- return fold_build2_loc (input_location,
- PLUS_EXPR, sizetype,
- array_type_nelts_minus_one (type),
- size_one_node);
-}
-
-/* Return, as an INTEGER_CST node, the number of elements for TYPE
(which is an ARRAY_TYPE). This one is a recursive count of all
ARRAY_TYPEs that are clumped together. */