aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorJanis Johnson <janis187@us.ibm.com>2010-01-21 05:49:35 +0000
committerJason Merrill <jason@gcc.gnu.org>2010-01-21 00:49:35 -0500
commitebf0bf7f49c75c98d4c51e8c451eae068a2dd647 (patch)
tree3bec735a0f06546a748f8a6b206f44f1a8b31297 /gcc/tree.h
parent907c6efdbc255042ab1ece9179511b78f426cb00 (diff)
downloadgcc-ebf0bf7f49c75c98d4c51e8c451eae068a2dd647.zip
gcc-ebf0bf7f49c75c98d4c51e8c451eae068a2dd647.tar.gz
gcc-ebf0bf7f49c75c98d4c51e8c451eae068a2dd647.tar.bz2
tree.h (TYPE_TRANSPARENT_UNION): Replace with ...
* tree.h (TYPE_TRANSPARENT_UNION): Replace with ... (TYPE_TRANSPARENT_AGGR): this, for union and record. * calls.c (initialize argument_information): Handle it. * c-common.c (handle_transparent_union_attribute): Use new name. * c-decl.c (finish_struct): Ditto. * c-typeck.c (type_lists_compatible_p): Ditto. (convert_for_assignment): Use new name and also handle record. * function.c (aggregate_value_p): Handle it. (pass_by_reference): Ditto. (assign_parm_data_types): Ditto. * print-tree.c (print_node): Ditto. * lto-streamer-in.c (unpack_ts_type_value_fields): Ditto. * lto-streamer-out.c (pack_ts_type_value_fields): Ditto. * tree.c (first_field): New fn. gcc/cp/ * mangle.c (write_type): Mangle transparent record as member type. * semantics.c (begin_class_definition): Recognize decimal classes and set TYPE_TRANSPARENT_AGGR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r156106
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index a0e1f67..f5827d5 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2251,16 +2251,18 @@ extern enum machine_mode vector_type_mode (const_tree);
#define TYPE_NEEDS_CONSTRUCTING(NODE) \
(TYPE_CHECK (NODE)->type.needs_constructing_flag)
-/* Indicates that objects of this type (a UNION_TYPE), should be passed
- the same way that the first union alternative would be passed. */
-#define TYPE_TRANSPARENT_UNION(NODE) \
- (UNION_TYPE_CHECK (NODE)->type.transparent_union_flag)
+/* Indicates that a UNION_TYPE object should be passed the same way that
+ the first union alternative would be passed, or that a RECORD_TYPE
+ object should be passed the same way that the first (and only) member
+ would be passed. */
+#define TYPE_TRANSPARENT_AGGR(NODE) \
+ (RECORD_OR_UNION_CHECK (NODE)->type.transparent_aggr_flag)
/* For an ARRAY_TYPE, indicates that it is not permitted to take the
address of a component of the type. This is the counterpart of
DECL_NONADDRESSABLE_P for arrays, see the definition of this flag. */
#define TYPE_NONALIASED_COMPONENT(NODE) \
- (ARRAY_TYPE_CHECK (NODE)->type.transparent_union_flag)
+ (ARRAY_TYPE_CHECK (NODE)->type.transparent_aggr_flag)
/* Indicated that objects of this type should be laid out in as
compact a way as possible. */
@@ -2285,7 +2287,7 @@ struct GTY(()) tree_type {
unsigned int precision : 10;
unsigned no_force_blk_flag : 1;
unsigned needs_constructing_flag : 1;
- unsigned transparent_union_flag : 1;
+ unsigned transparent_aggr_flag : 1;
unsigned restrict_flag : 1;
unsigned contains_placeholder_bits : 2;
@@ -4360,6 +4362,10 @@ extern int list_length (const_tree);
extern int fields_length (const_tree);
+/* Returns the first FIELD_DECL in a type. */
+
+extern tree first_field (const_tree);
+
/* Given an initializer INIT, return TRUE if INIT is zero or some
aggregate of zeros. Otherwise return FALSE. */