OSDN Git Service

2007-04-20 Eric Botcazou <ebotcazou@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Jun 2007 10:16:27 +0000 (10:16 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Jun 2007 10:16:27 +0000 (10:16 +0000)
commit6e8e9136561bdfae711aadcf2644668000932c5b
treec006dfb8719fcd3af52284c204a61aae265d4dd9
parentee3388c4d50f39bfa8769d8cba350d5de6ced586
2007-04-20  Eric Botcazou  <ebotcazou@adacore.com>
    Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
    Olivier Hainque  <hainque@adacore.com>

* decl.c (gnat_to_gnu_entity) <object>: Manually mark the top of the
renamed expression of a full renaming at toplevel.
(gnat_to_gnu_entity, case object): If not defining, do not look inside
the values the constant is initialized to if it is an N_Allocator.
(gnat_to_gnu_entity) <E_Array_Subtype>: Manually mark the top of the
TYPE_SIZE_UNIT of inner types after the stride is elaborated.
(make_aligning_type): Accept an extra ROOM argument for storage to be
made available before the aligned field, and an extra BASE_ALIGN
argument for callers to pass the alignment guaranteed to be honored for
the whole aligning object. Avoid call to finish_record_type, which only
interferes with the sizes we want to set.
(gnat_to_gnu_entity) <E_Variable>: Pass the required extra arguments to
make_aligning_type for super-aligned objects on stack.
(components_to_record): Pass the adjusted size of the type when creating
fields in the qualified union for the variant part.
(gnat_substitute_in_type): Copy TYPE_USER_ALIGN.
(gnat_to_gnu_entity, case E_Signed_Integer_Subtype): Likewise for
packed array type.
(maybe_pad_type): Set TYPE_USER_ALIGN.
(make_aligning_type): Likewise.
ALIGN argument is unsigned int.
(gnat_to_gnu_entity, case E_Function): Back annotate return mechanism.
(gnat_to_gnu_param): Likewise, for parameters.
(gnat_to_gnu_entity) <object>: Always instantiate the renaming object
if it is constant and stems from a function call.
(gnat_to_gnu_entity) <E_Record_Type>: Set packed to -2 if the alignment
of the record is specified.  Adjust accordingly.
(adjust_packed): New static function.
(gnat_to_gnu_field): Use it to adjust the packedness setting.
(components_to_record): Likewise.
(gnat_to_gnu_entity) <object>: Do not test the renamed expression for
side-effects if the object is deemed constant.
(gnat_to_gnu_entity) <E_Array_Type>: Create a name for the fat pointer
type instead of merely finalizing it.  Tidy.
<E_Access_Subprogram_Type>: Retrieve the type from the TYPE_DECL.
<E_Access_Type>: Likewise.
(defer_debug_incomplete_list): Rename to defer_finalize_list.
(defer_debug_level): Delete.
(gnat_to_gnu_entity) <debug_deferred>: Likewise
<E_Array_Type>: Call rest_of_record_type_compilation on the fat pointer
type.
<E_Record_Type>: Do not explicitly defer finalizing the type.
Adjust for write_record_type_debug_info renaming.
<E_Subprogram_Type>: Likewise.
Finalize deferred types right after deferred incomplete types are
expanded.
(rest_of_type_decl_compilation): New global function.
(components_to_record): Rename defer_debug parameter to do_not_finalize.
(components_to_record): Propagate the packedness to the fields of the
qualified union type if there is a variant part.
(gnat_to_gnu_entity) <E_Array_Type>: Use new function
instead of inline code to adjust the XUT field offsets.
(gnat_to_gnu_entity): Adjust for new prototype of finish_record_type.
<E_Record_Subtype>: Do not let finish_record_type compute the sizes
and write the debug info if the type derives from a discriminated one.
(gnat_to_gnu_entity) <E_Array_Type>: Adjust call to create_index_type.
<E_Array_Subtype>: Likewise.
<E_String_Literal_Subtype>: Likewise.
(gnat_to_gnu_entity): Set TYPE_USER_ALIGN on types only if they have
an alignment clause.
(maybe_pad_type): Update ORIG_SIZE to the minimum required to meet ALIGN
before giving warning.
(prepend_one_attribute_to): New function, helper to prepend an attribute
to an attribute list.
(gnat_to_gnu_entity) <E_Procedure>: Use it.
(prepend_attributes): Likewise.
(gnat_to_gnu_entity) <E_Variable>: Use constants of the proper type.
<E_Array_Type>: Declare the padding type for the element type, if any.
<E_Array_Subtype>: Likewise.
(defer_limited_with): New variable.
(Gigi_Equivalent_Type): New function.
(gnat_to_gnu_entity): Use it at start and use result throughout.
(gnat_to_gnu_entity, case E_Access_Type): Rework to use
Gigi_Equivalent_Type, support Limited_With, allow two levels of
indirection, precompute if unconstrained array to simplify logic, and
use defer_limited_with to defer elaboration of some types from limited
with.
(finalize_from_with_types): New function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125370 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/decl.c