diff options
| author | Tristan Gingold <gingold@adacore.com> | 2012-02-27 17:25:28 +0000 |
|---|---|---|
| committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2012-02-27 17:25:28 +0000 |
| commit | 2afda005e1a9117b67c4094b6a23590ea1646524 (patch) | |
| tree | 73d40ff35bfb198a0911e580b2ab06e0f609f407 /gcc/ada/gcc-interface/decl.c | |
| parent | afbf6e97a557f6af04aac6eeba3de6c20f0082f7 (diff) | |
| download | gcc-2afda005e1a9117b67c4094b6a23590ea1646524.zip gcc-2afda005e1a9117b67c4094b6a23590ea1646524.tar.gz gcc-2afda005e1a9117b67c4094b6a23590ea1646524.tar.bz2 | |
decl.c (gnat_to_gnu_entity): Reuse dummy fat type for gnu_ptr_template and gnu_template_type.
* gcc-interface/decl.c (gnat_to_gnu_entity) [E_String_Type,
E_Array_Type]: Reuse dummy fat type for gnu_ptr_template and
gnu_template_type.
From-SVN: r184605
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
| -rw-r--r-- | gcc/ada/gcc-interface/decl.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index e47aca4..80ad5a3 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -2003,8 +2003,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) const bool convention_fortran_p = (Convention (gnat_entity) == Convention_Fortran); const int ndim = Number_Dimensions (gnat_entity); - tree gnu_template_type = make_node (RECORD_TYPE); - tree gnu_ptr_template = build_pointer_type (gnu_template_type); + tree gnu_template_type; + tree gnu_ptr_template; tree gnu_template_reference, gnu_template_fields, gnu_fat_type; tree *gnu_index_types = XALLOCAVEC (tree, ndim); tree *gnu_temp_fields = XALLOCAVEC (tree, ndim); @@ -2035,9 +2035,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) TYPE_NAME (gnu_fat_type) = NULL_TREE; /* Save the contents of the dummy type for update_pointer_to. */ TYPE_POINTER_TO (gnu_type) = copy_type (gnu_fat_type); + gnu_ptr_template = + TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_fat_type))); + gnu_template_type = TREE_TYPE (gnu_ptr_template); } else - gnu_fat_type = make_node (RECORD_TYPE); + { + gnu_fat_type = make_node (RECORD_TYPE); + gnu_template_type = make_node (RECORD_TYPE); + gnu_ptr_template = build_pointer_type (gnu_template_type); + } /* Make a node for the array. If we are not defining the array suppress expanding incomplete types. */ |
