]> gcc.gnu.org Git - gcc.git/commit
tree.h (CONSTRUCTOR_BITFIELD_P): True if NODE...
authorOlivier Hainque <hainque@adacore.com>
Mon, 1 Jun 2009 14:42:56 +0000 (14:42 +0000)
committerOlivier Hainque <hainque@gcc.gnu.org>
Mon, 1 Jun 2009 14:42:56 +0000 (14:42 +0000)
commit324c9b0242c7ea8604f8aa694d75a2e4ba075636
tree2fb071a57ee2fbe016eadc8f563a7c7f8a70a306
parent0980d7fe0b2f311dfc8e8d644d07a0a04f3cdf0c
tree.h (CONSTRUCTOR_BITFIELD_P): True if NODE...

* tree.h (CONSTRUCTOR_BITFIELD_P): True if NODE, a FIELD_DECL, is
to be processed as a bitfield for constructor output purposes.
* output.h (initializer_constant_valid_for_bitfield_p): Declare
new function.
* varasm.c (oc_local_state): New type, output_constructor
local state to support communication with helpers.
(oc_outer_state): New type, output_constructor outer state of
relevance in recursive calls.
(output_constructor_array_range): New output_constructor helper,
extracted code for an array range element.
(output_constructor_regular_field): New output_constructor helper,
extracted code for an element that is not a bitfield.
(output_constructor_bitfield): New output_constructor helper,
extracted code for a bitfield element.  Accept an OUTER state
argument for recursive processing.  Recurse on record or array
CONSTRUCTOR values, possibly past noop conversions.
(initializer_constant_valid_for_bitfield_p): New predicate. Whether
VALUE is a valid constant-valued expression for use in a static
bit-field initializer.
(output_constructor): Rework to use helpers. Accept and honor an
OUTER state argument for recursive calls. Return total size. Be
prepared for nested constructors initializing bitfields.
(output_constant): Feed OUTER in calls to output_constructor.

ada/
* gcc-interface/utils2.c (gnat_build_constructor): Factor
out code. Use initializer_constant_valid_for_bitfield_p and
CONSTRUCTOR_BITFIELD_P for bit-fields.

testsuite/
* gnat.dg/oconst[1-6].ad[bs]: New tests. Also support for ...
* gnat.dg/test_oconst.adb: New test.

Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>
From-SVN: r148045
19 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils2.c
gcc/output.h
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/oconst1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/oconst1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/oconst2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/oconst2.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/oconst3.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/oconst3.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/oconst4.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/oconst4.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/oconst5.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/oconst5.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/oconst6.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/test_oconst.adb [new file with mode: 0644]
gcc/tree.h
gcc/varasm.c
This page took 0.0613 seconds and 5 git commands to generate.