summaryrefslogtreecommitdiff
path: root/gcc/output.h
diff options
context:
space:
mode:
authorhainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-18 13:07:28 +0000
committerhainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-18 13:07:28 +0000
commit20169a6424f72bb0852b222ccd726793317904d1 (patch)
tree4065694fdb2ca6a3a4f7e10356db5f8774473035 /gcc/output.h
parent3e427a9c6d314d755d819b33eaede97c3b227127 (diff)
downloadgcc-20169a6424f72bb0852b222ccd726793317904d1.tar.gz
* tree.h (categorize_ctor_elements): Adjust prototype and add
descriptive comment, both in accordance with the interface change described below. * varasm.c (constructor_static_from_elts_p): New function. Whether a constructor node is a valid static constant initializer if all its elements are. (initializer_constant_valid_p) <CONSTRUCTOR value>: Use it. * output.h: Declare it. * expr.c (categorize_ctor_elements_1): Return whether the constructor is a valid constant initializer instead of computing the number of non-constant elements. Use constructor_static_from_elts_p for this purpose. Replace the head comment with an indication that this is a helper for categorize_ctor_elements. (categorize_ctor_elements): Same interface change as for the _1 helper. Former head comment from this helper moved here, adjusted to account for the interface changes. (mostly_zeros_p): Adjust call to categorize_ctor_elements. (all_zeros_p): Likewise. * gimplify.c (gimplify_init_constructor): Decide whether we can make static versions of the constructor from the categorize_ctor_elements return value instead of the formerly computed number of non-constant elements. * gnat.dg/outer_agg_bitfield_constructor.adb: New test. * gnat.dg/nested_agg_bitfield_constructor.adb: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115553 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/output.h')
-rw-r--r--gcc/output.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/output.h b/gcc/output.h
index 6d518c45803..3cfe32c93cf 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -280,6 +280,13 @@ extern void output_shared_constant_pool (void);
extern void output_object_blocks (void);
+/* Whether a constructor CTOR is a valid static constant initializer if all
+ its elements are. This used to be internal to initializer_constant_valid_p
+ and has been exposed to let other functions like categorize_ctor_elements
+ evaluate the property while walking a constructor for other purposes. */
+
+extern bool constructor_static_from_elts_p (tree);
+
/* Return nonzero if VALUE is a valid constant-valued expression
for use in initializing a static variable; one that can be an
element of a "constant" initializer.