OSDN Git Service

* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Adjust
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 20 Nov 2011 10:03:11 +0000 (10:03 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 20 Nov 2011 10:03:11 +0000 (10:03 +0000)
commit68e668ce5a62f178432a81ad8d4b7041318de51e
tree8c3bf3eed49ecfca419ebe789652ad0382b632ed
parent16e1106634e18bbf9a6154435e3ce4f373defa65
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Adjust
call to components_to_record.
(components_to_record): Add FIRST_FREE_POS parameter.  For the variant
part, reuse enclosing union even if there is a representation clause
on the Unchecked_Union.  If there is a variant part, compute the new
first free position, if any.  Adjust call to self.  Use a single field
directly only if it hasn't got a representation clause or is placed at
offset zero.  Create the variant part at offset 0 if all the fields
down to this level have a rep clause.  Do not chain the variant part
immediately and adjust downstream.
Do not test ALL_REP before moving the fields without rep clause to the
previous level.  Call create_rep_part to create the REP part and force
a minimum size on it if necessary.  Do not chain it immediately.
Create a fake REP part if there are fields without rep clause that need
to be laid out starting from FIRST_FREE_POS.
At the end, chain the REP part and then the variant part.
(create_rep_part): New function.
(get_rep_part): Minor tweak.
* gcc-interface/utils.c (tree_code_for_record_type): Minor tweak.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181526 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/utils.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/discr32.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/discr32_pkg.ads [new file with mode: 0644]