aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2002-02-05 17:56:34 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2002-02-05 17:56:34 +0000
commitf913c102a4836355a7d9769a7d5998f27032ed98 (patch)
tree3a2fa33e655d88a836f10525dd980faa2d69aff9 /gcc/doc
parentc13db5d119dd543d25d410ec9622be07e186bdff (diff)
downloadgcc-f913c102a4836355a7d9769a7d5998f27032ed98.zip
gcc-f913c102a4836355a7d9769a7d5998f27032ed98.tar.gz
gcc-f913c102a4836355a7d9769a7d5998f27032ed98.tar.bz2
target.h (struct gcc_target): Added ms_bitfield_layout_p.
* target.h (struct gcc_target): Added ms_bitfield_layout_p. * target-def.h (TARGET_MS_BITFIELD_LAYOUT_P): New. Added to... (TARGET_INITIALIZER): this. * doc/tm.texi (TARGET_MS_BITFIELD_LAYOUT_P): Document. (BITFIELD_NBYTES_LIMITED): Markup fix. * tree.h (default_ms_bitfield_layout_p): Declare. (record_layout_info): Added prev_field. * tree.c (default_ms_bitfield_layout_p): New fn. * c-decl.c (finish_struct): Disregard EMPTY_FIELD_BOUNDARY and PCC_BITFIELD_TYPE_MATTERS for MS bit-field layout. * stor-layout.c: Include target.h. (start_record_layout): Initialize prev_field. (place_field): Handle MS bit-field layout, and disregard EMPTY_FIELD_BOUNDARY, BITFIELD_NBYTES_LIMITED and PCC_BITFIELD_TYPE_MATTERS in this case. Update prev_field. * Makefile.in (stor-layout.o): Adjust dependencies. From-SVN: r49526
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/tm.texi18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index c81cd26..ff25523 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1199,8 +1199,8 @@ get from @code{PCC_BITFIELD_TYPE_MATTERS}.
@findex BITFIELD_NBYTES_LIMITED
@item BITFIELD_NBYTES_LIMITED
-Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to
-aligning a bit-field within the structure.
+Like @code{PCC_BITFIELD_TYPE_MATTERS} except that its effect is limited
+to aligning a bit-field within the structure.
@findex MEMBER_TYPE_FORCES_BLK
@item MEMBER_TYPE_FORCES_BLK (@var{field})
@@ -1329,6 +1329,20 @@ memory is controlled by @code{FLOAT_WORDS_BIG_ENDIAN}.
@end table
+@deftypefn {Target Hook} bool TARGET_MS_BITFIELD_LAYOUT_P (tree @var{record_type})
+This target hook returns @code{true} if bit-fields in the given
+@var{record_type} are to be laid out following the rules of Microsoft
+Visual C/C++, namely: (i) a bit-field won't share the same storage
+unit with the previous bit-field if their underlying types have
+different sizes, and the bit-field will be aligned to the highest
+alignment of the underlying types of itself and of the previous
+bit-field; (ii) a zero-sized bit-field will affect the alignment of
+the whole enclosing structure, even if it is unnamed; except that
+(iii) a zero-sized bit-field will be disregarded unless it follows
+another bit-field of non-zero size. If this hook returns @code{true},
+other macros that control bit-field layout are ignored.
+@end deftypefn
+
@node Type Layout
@section Layout of Source Language Data Types