aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-09-23 09:34:43 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-09-23 09:34:43 +0200
commitaaa1b10f5419420ef419b6f74299e516f19e5877 (patch)
tree829166a3567a2a3dc49d4bf5253352ed8360678b /gcc/cp
parent9500733cc644b84402dce9a53eb32bfa50cfd4a5 (diff)
downloadgcc-aaa1b10f5419420ef419b6f74299e516f19e5877.zip
gcc-aaa1b10f5419420ef419b6f74299e516f19e5877.tar.gz
gcc-aaa1b10f5419420ef419b6f74299e516f19e5877.tar.bz2
* 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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/decl.c4
-rw-r--r--gcc/cp/typeck2.c4
3 files changed, 12 insertions, 4 deletions
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 <jakub@redhat.com>
+
+ * 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 <paolo.carlini@oracle.com>
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<tree, va_gc> **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);