From aaa1b10f5419420ef419b6f74299e516f19e5877 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 23 Sep 2016 09:34:43 +0200 Subject: * hsa-gen.c (hsa_op_immed::hsa_op_immed Use CONSTRUCTOR_NELTS (...) instead of vec_safe_length (CONSTRUCTOR_ELTS (...)). (gen_hsa_ctor_assignment): Likewise. * print-tree.c (print_node): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-sra.c (sra_modify_constructor_assign): Likewise. * expr.c (store_constructor): Likewise. * fold-const.c (operand_equal_p): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * hsa-brig.c (hsa_op_immed::emit_to_buffer): Likewise. * ipa-icf-gimple.c (func_checker::compare_operand): Likewise. cp/ * typeck2.c (process_init_constructor_record): Use CONSTRUCTOR_NELTS (...) instead of vec_safe_length (CONSTRUCTOR_ELTS (...)). * decl.c (reshape_init_r): Likewise. (check_initializer): Likewise. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use CONSTRUCTOR_NELTS (...) instead of vec_safe_length (CONSTRUCTOR_ELTS (...)). From-SVN: r240390 --- gcc/cp/ChangeLog | 8 ++++++++ gcc/cp/decl.c | 4 ++-- gcc/cp/typeck2.c | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3a4d1f4..ae59343 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2016-09-23 Jakub Jelinek + + * typeck2.c (process_init_constructor_record): Use + CONSTRUCTOR_NELTS (...) instead of + vec_safe_length (CONSTRUCTOR_ELTS (...)). + * decl.c (reshape_init_r): Likewise. + (check_initializer): Likewise. + 2016-09-22 Paolo Carlini PR c++/71979 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 921f8d5..24f71ce 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5933,7 +5933,7 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p, element (as allowed by [dcl.init.string]). */ if (!first_initializer_p && TREE_CODE (str_init) == CONSTRUCTOR - && vec_safe_length (CONSTRUCTOR_ELTS (str_init)) == 1) + && CONSTRUCTOR_NELTS (str_init) == 1) { str_init = (*CONSTRUCTOR_ELTS (str_init))[0].value; } @@ -6136,7 +6136,7 @@ check_initializer (tree decl, tree init, int flags, vec **cleanups) if (init && BRACE_ENCLOSED_INITIALIZER_P (init)) { - int init_len = vec_safe_length (CONSTRUCTOR_ELTS (init)); + int init_len = CONSTRUCTOR_NELTS (init); if (SCALAR_TYPE_P (type)) { if (init_len == 0) diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index b9dc56d..6e22685 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1379,7 +1379,7 @@ process_init_constructor_record (tree type, tree init, if (type == error_mark_node) return PICFLAG_ERRONEOUS; - if (idx < vec_safe_length (CONSTRUCTOR_ELTS (init))) + if (idx < CONSTRUCTOR_NELTS (init)) { constructor_elt *ce = &(*CONSTRUCTOR_ELTS (init))[idx]; if (ce->index) @@ -1476,7 +1476,7 @@ process_init_constructor_record (tree type, tree init, CONSTRUCTOR_APPEND_ELT (v, field, next); } - if (idx < vec_safe_length (CONSTRUCTOR_ELTS (init))) + if (idx < CONSTRUCTOR_NELTS (init)) { if (complain & tf_error) error ("too many initializers for %qT", type); -- cgit v1.1