diff options
author | Richard Sandiford <rsandifo@gcc.gnu.org> | 2011-07-13 11:16:36 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2011-07-13 11:16:36 +0000 |
commit | 953d0c90a2f0a98b6d860ecfbf1bc5672653a588 (patch) | |
tree | b416f9a74ed2aeda3b26a2a7af943a1535790bb3 /gcc/tree.h | |
parent | 9111c715537d8ea0829d6ab7511017ed8658f303 (diff) | |
download | gcc-953d0c90a2f0a98b6d860ecfbf1bc5672653a588.zip gcc-953d0c90a2f0a98b6d860ecfbf1bc5672653a588.tar.gz gcc-953d0c90a2f0a98b6d860ecfbf1bc5672653a588.tar.bz2 |
tree.h (categorize_ctor_elements): Remove comment.
gcc/
* tree.h (categorize_ctor_elements): Remove comment. Fix long line.
(count_type_elements): Delete.
(complete_ctor_at_level_p): Declare.
* expr.c (flexible_array_member_p): New function, split out from...
(count_type_elements): ...here. Make static. Replace allow_flexarr
parameter with for_ctor_p. When for_ctor_p is true, return the
number of elements that should appear in the top-level constructor,
otherwise return an estimate of the number of scalars.
(categorize_ctor_elements): Replace p_must_clear with p_complete.
(categorize_ctor_elements_1): Likewise. Use complete_ctor_at_level_p.
(complete_ctor_at_level_p): New function, borrowing union logic
from old categorize_ctor_elements_1.
(mostly_zeros_p): Return true if the constructor is not complete.
(all_zeros_p): Update call to categorize_ctor_elements.
* gimplify.c (gimplify_init_constructor): Update call to
categorize_ctor_elements. Don't call count_type_elements.
Unconditionally prevent clearing for variable-sized types,
otherwise rely on categorize_ctor_elements to detect
incomplete initializers.
gcc/cp/
* typeck2.c (split_nonconstant_init_1): Pass the initializer directly,
rather than a pointer to it. Return true if the whole of the value
was initialized by the generated statements. Use
complete_ctor_at_level_p instead of count_type_elements.
gcc/testsuite/
2011-07-12 Chung-Lin Tang <cltang@codesourcery.com>
* gcc.target/arm/pr48183.c: New test.
From-SVN: r176228
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 17 |
1 files changed, 3 insertions, 14 deletions
@@ -4804,21 +4804,10 @@ extern bool initializer_zerop (const_tree); extern VEC(tree,gc) *ctor_to_vec (tree); -/* Examine CTOR to discover: - * how many scalar fields are set to nonzero values, - and place it in *P_NZ_ELTS; - * how many scalar fields in total are in CTOR, - and place it in *P_ELT_COUNT. - * if a type is a union, and the initializer from the constructor - is not the largest element in the union, then set *p_must_clear. +extern bool categorize_ctor_elements (const_tree, HOST_WIDE_INT *, + HOST_WIDE_INT *, bool *); - Return whether or not CTOR is a valid static constant initializer, the same - as "initializer_constant_valid_p (CTOR, TREE_TYPE (CTOR)) != 0". */ - -extern bool categorize_ctor_elements (const_tree, HOST_WIDE_INT *, HOST_WIDE_INT *, - bool *); - -extern HOST_WIDE_INT count_type_elements (const_tree, bool); +extern bool complete_ctor_at_level_p (const_tree, HOST_WIDE_INT, const_tree); /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0. */ |