diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-11 16:55:29 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-11 16:55:29 +0000 |
commit | 4c163af5e77c2035147a1e60bc84e58b75971e3f (patch) | |
tree | 9d801bea0646b4030a6ef1115de2690dafea369c /gcc/doc | |
parent | 28cd2e890dca7851c9ddd3a3de59c0e877f55385 (diff) | |
download | gcc-4c163af5e77c2035147a1e60bc84e58b75971e3f.tar.gz |
* tree.h (CONSTRUCTOR_NO_CLEARING): Define.
* tree-core.h (CONSTRUCTOR_NO_CLEARING): Document it.
* tree.def (CONSTRUCTOR): Likewise.
* doc/generic.texi (CONSTRUCTOR): Likewise. Update description.
* gimplify.c (gimplify_init_constructor): Do not clear the object when
the constructor is incomplete and CONSTRUCTOR_NO_CLEARING is set.
ada/
* gcc-interface/utils2.c (gnat_build_constructor): Also set the flag
CONSTRUCTOR_NO_CLEARING on the constructor.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204677 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/generic.texi | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/gcc/doc/generic.texi b/gcc/doc/generic.texi index 73dd1236412..f2dd0ffae65 100644 --- a/gcc/doc/generic.texi +++ b/gcc/doc/generic.texi @@ -1616,29 +1616,31 @@ of temporaries during the evaluation of that expression should be performed immediately after the expression is evaluated. @item CONSTRUCTOR -These nodes represent the brace-enclosed initializers for a structure or -array. The first operand is reserved for use by the back end. The -second operand is a @code{TREE_LIST}. If the @code{TREE_TYPE} of the -@code{CONSTRUCTOR} is a @code{RECORD_TYPE} or @code{UNION_TYPE}, then -the @code{TREE_PURPOSE} of each node in the @code{TREE_LIST} will be a -@code{FIELD_DECL} and the @code{TREE_VALUE} of each node will be the -expression used to initialize that field. - -If the @code{TREE_TYPE} of the @code{CONSTRUCTOR} is an -@code{ARRAY_TYPE}, then the @code{TREE_PURPOSE} of each element in the -@code{TREE_LIST} will be an @code{INTEGER_CST} or a @code{RANGE_EXPR} of -two @code{INTEGER_CST}s. A single @code{INTEGER_CST} indicates which -element of the array (indexed from zero) is being assigned to. A -@code{RANGE_EXPR} indicates an inclusive range of elements to -initialize. In both cases the @code{TREE_VALUE} is the corresponding +These nodes represent the brace-enclosed initializers for a structure or an +array. They contain a sequence of component values made out of a vector of +constructor_elt, which is a (@code{INDEX}, @code{VALUE}) pair. + +If the @code{TREE_TYPE} of the @code{CONSTRUCTOR} is a @code{RECORD_TYPE}, +@code{UNION_TYPE} or @code{QUAL_UNION_TYPE} then the @code{INDEX} of each +node in the sequence will be a @code{FIELD_DECL} and the @code{VALUE} will +be the expression used to initialize that field. + +If the @code{TREE_TYPE} of the @code{CONSTRUCTOR} is an @code{ARRAY_TYPE}, +then the @code{INDEX} of each node in the sequence will be an +@code{INTEGER_CST} or a @code{RANGE_EXPR} of two @code{INTEGER_CST}s. +A single @code{INTEGER_CST} indicates which element of the array is being +assigned to. A @code{RANGE_EXPR} indicates an inclusive range of elements +to initialize. In both cases the @code{VALUE} is the corresponding initializer. It is re-evaluated for each element of a -@code{RANGE_EXPR}. If the @code{TREE_PURPOSE} is @code{NULL_TREE}, then +@code{RANGE_EXPR}. If the @code{INDEX} is @code{NULL_TREE}, then the initializer is for the next available array element. In the front end, you should not depend on the fields appearing in any particular order. However, in the middle end, fields must appear in declaration order. You should not assume that all fields will be -represented. Unrepresented fields will be set to zero. +represented. Unrepresented fields will be cleared (zeroed), unless the +CONSTRUCTOR_NO_CLEARING flag is set, in which case their value becomes +undefined. @item COMPOUND_LITERAL_EXPR @findex COMPOUND_LITERAL_EXPR_DECL_EXPR |