Commit 583eb0c9 by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Do not make fat pointer types artificial unconditionally.

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Do not make
	fat pointer types artificial unconditionally.
	<E_Array_Subtype>: Attach the base array type as a parallel type if it
	isn't artificial.

From-SVN: r171883
parent e3edbd56
2011-04-02 Eric Botcazou <ebotcazou@adacore.com> 2011-04-02 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Do not make
fat pointer types artificial unconditionally.
<E_Array_Subtype>: Attach the base array type as a parallel type if it
isn't artificial.
2011-04-02 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/gigi.h (get_dummy_type): Declare. * gcc-interface/gigi.h (get_dummy_type): Declare.
(build_dummy_unc_pointer_types): Likewise. (build_dummy_unc_pointer_types): Likewise.
(finish_fat_pointer_type): Likewise. (finish_fat_pointer_type): Likewise.
......
...@@ -2175,7 +2175,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -2175,7 +2175,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
else else
gnat_name = gnat_entity; gnat_name = gnat_entity;
create_type_decl (create_concat_name (gnat_name, "XUP"), create_type_decl (create_concat_name (gnat_name, "XUP"),
gnu_fat_type, NULL, true, gnu_fat_type, NULL, !Comes_From_Source (gnat_entity),
debug_info_p, gnat_entity); debug_info_p, gnat_entity);
/* Create the type to be used as what a thin pointer designates: /* Create the type to be used as what a thin pointer designates:
...@@ -2537,14 +2537,25 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -2537,14 +2537,25 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
add_parallel_type (TYPE_STUB_DECL (gnu_type), gnu_bound_rec); add_parallel_type (TYPE_STUB_DECL (gnu_type), gnu_bound_rec);
} }
/* Otherwise, for a packed array, make the original array type a /* If this is a packed array type, make the original array type a
parallel type. */ parallel type. Otherwise, do it for the base array type if it
else if (debug_info_p isn't artificial to make sure it is kept in the debug info. */
&& Is_Packed_Array_Type (gnat_entity) if (debug_info_p)
&& present_gnu_tree (Original_Array_Type (gnat_entity))) {
add_parallel_type (TYPE_STUB_DECL (gnu_type), if (Is_Packed_Array_Type (gnat_entity)
gnat_to_gnu_type && present_gnu_tree (Original_Array_Type (gnat_entity)))
(Original_Array_Type (gnat_entity))); add_parallel_type (TYPE_STUB_DECL (gnu_type),
gnat_to_gnu_type
(Original_Array_Type (gnat_entity)));
else
{
tree gnu_base_decl
= gnat_to_gnu_entity (Etype (gnat_entity), NULL_TREE, 0);
if (!DECL_ARTIFICIAL (gnu_base_decl))
add_parallel_type (TYPE_STUB_DECL (gnu_type),
TREE_TYPE (TREE_TYPE (gnu_base_decl)));
}
}
TYPE_CONVENTION_FORTRAN_P (gnu_type) = convention_fortran_p; TYPE_CONVENTION_FORTRAN_P (gnu_type) = convention_fortran_p;
TYPE_PACKED_ARRAY_TYPE_P (gnu_type) TYPE_PACKED_ARRAY_TYPE_P (gnu_type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment