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
+2016-09-23 Jakub Jelinek <jakub@redhat.com>
+
+ * 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.
+
2016-09-23 Richard Biener <rguenther@suse.de>
* hooks.h (hook_uint_uintp_false): Declare.
+2016-09-23 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Use
+ CONSTRUCTOR_NELTS (...) instead of
+ vec_safe_length (CONSTRUCTOR_ELTS (...)).
+
2016-07-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Also use
= TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_alloc_type)));
if (TREE_CODE (gnu_expr) == CONSTRUCTOR
- && vec_safe_length (CONSTRUCTOR_ELTS (gnu_expr)) == 1)
+ && CONSTRUCTOR_NELTS (gnu_expr) == 1)
gnu_expr = NULL_TREE;
else
gnu_expr
+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
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;
}
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)
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)
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);
register whose mode size isn't equal to SIZE since
clear_storage can't handle this case. */
else if (size > 0
- && (((int)vec_safe_length (CONSTRUCTOR_ELTS (exp))
- != fields_length (type))
+ && (((int) CONSTRUCTOR_NELTS (exp) != fields_length (type))
|| mostly_zeros_p (exp))
&& (!REG_P (target)
|| ((HOST_WIDE_INT) GET_MODE_SIZE (GET_MODE (target))
case CONSTRUCTOR:
/* In GIMPLE empty constructors are allowed in initializers of
aggregates. */
- return (!vec_safe_length (CONSTRUCTOR_ELTS (arg0))
- && !vec_safe_length (CONSTRUCTOR_ELTS (arg1)));
+ return !CONSTRUCTOR_NELTS (arg0) && !CONSTRUCTOR_NELTS (arg1);
default:
break;
}
}
else if (TREE_CODE (m_tree_value) == CONSTRUCTOR)
{
- unsigned len = vec_safe_length (CONSTRUCTOR_ELTS (m_tree_value));
+ unsigned len = CONSTRUCTOR_NELTS (m_tree_value);
for (unsigned i = 0; i < len; i++)
{
tree v = CONSTRUCTOR_ELT (m_tree_value, i)->value;
/* Verify that all elements of a constructor are constants. */
if (TREE_CODE (m_tree_value) == CONSTRUCTOR)
- for (unsigned i = 0;
- i < vec_safe_length (CONSTRUCTOR_ELTS (m_tree_value)); i++)
+ for (unsigned i = 0; i < CONSTRUCTOR_NELTS (m_tree_value); i++)
{
tree v = CONSTRUCTOR_ELT (m_tree_value, i)->value;
if (!CONSTANT_CLASS_P (v))
gen_hsa_ctor_assignment (hsa_op_address *addr_lhs, tree rhs, hsa_bb *hbb,
BrigAlignment8_t align)
{
- if (vec_safe_length (CONSTRUCTOR_ELTS (rhs)))
+ if (CONSTRUCTOR_NELTS (rhs))
{
HSA_SORRY_AT (EXPR_LOCATION (rhs),
"support for HSA does not implement load from constructor");
{
case CONSTRUCTOR:
{
- unsigned length1 = vec_safe_length (CONSTRUCTOR_ELTS (t1));
- unsigned length2 = vec_safe_length (CONSTRUCTOR_ELTS (t2));
+ unsigned length1 = CONSTRUCTOR_NELTS (t1);
+ unsigned length2 = CONSTRUCTOR_NELTS (t2);
if (length1 != length2)
return return_false ();
{
unsigned HOST_WIDE_INT cnt;
tree index, value;
- len = vec_safe_length (CONSTRUCTOR_ELTS (node));
+ len = CONSTRUCTOR_NELTS (node);
fprintf (file, " lngt %d", len);
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node),
cnt, index, value)
{
unsigned HOST_WIDE_INT cnt;
tree index, value;
- dump_int (di, "lngt", vec_safe_length (CONSTRUCTOR_ELTS (t)));
+ dump_int (di, "lngt", CONSTRUCTOR_NELTS (t));
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (t), cnt, index, value)
{
dump_child ("idx", index);
dump_decl_name (pp, val, flags);
else
dump_generic_node (pp, val, spc, flags, false);
- if (ix != vec_safe_length (CONSTRUCTOR_ELTS (node)) - 1)
+ if (ix != CONSTRUCTOR_NELTS (node) - 1)
{
pp_comma (pp);
pp_space (pp);
return SRA_AM_MODIFIED;
}
- if (vec_safe_length (CONSTRUCTOR_ELTS (gimple_assign_rhs1 (stmt))) > 0)
+ if (CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt)) > 0)
{
/* I have never seen this code path trigger but if it can happen the
following should handle it gracefully. */