diff options
| author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-02-22 15:12:55 +0100 |
|---|---|---|
| committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-02-22 15:12:55 +0100 |
| commit | 9aa04cc733440f0b9d1511d0453e38351546141b (patch) | |
| tree | 0ca3eebfb23972eb52bb66139e169b1ffc2e8701 /gcc/ada/gcc-interface/decl.c | |
| parent | aab081301183b100541e48100c11281435b9e286 (diff) | |
| download | gcc-9aa04cc733440f0b9d1511d0453e38351546141b.zip gcc-9aa04cc733440f0b9d1511d0453e38351546141b.tar.gz gcc-9aa04cc733440f0b9d1511d0453e38351546141b.tar.bz2 | |
[multiple changes]
2012-02-22 Robert Dewar <dewar@adacore.com>
* exp_util.adb, make.adb, sem_dim.adb, sem_ch4.adb, exp_disp.adb: Minor
reformatting.
2012-02-22 Geert Bosch <bosch@adacore.com>
* g-bytswa-x86.adb, g-bytswa.adb, gcc-interface/Makefile.in: Remove
x86-specific version of byteswap and use GCC builtins instead.
2012-02-22 Tristan Gingold <gingold@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) [E_String_Type,
E_Array_Type]: Translate component ealier.
2012-02-22 Robert Dewar <dewar@adacore.com>
* par-ch3.adb (P_Signed_Integer_Type_Definition): Specialize
error message for 'Range.
From-SVN: r184480
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
| -rw-r--r-- | gcc/ada/gcc-interface/decl.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index c3c4f99..10e9c8d 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -2003,6 +2003,18 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) tree gnu_max_size = size_one_node, gnu_max_size_unit, tem, t; Entity_Id gnat_index, gnat_name; int index; + tree comp_type; + + /* Create the type for the component now, as it simplifies breaking + type reference loops. */ + comp_type + = gnat_to_gnu_component_type (gnat_entity, definition, debug_info_p); + if (present_gnu_tree (gnat_entity)) + { + /* As a side effect, the type may have been translated. */ + maybe_present = true; + break; + } /* We complete an existing dummy fat pointer type in place. This both avoids further complex adjustments in update_pointer_to and yields @@ -2173,29 +2185,28 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) debug_info_p); TYPE_READONLY (gnu_template_type) = 1; - /* Now make the array of arrays and update the pointer to the array - in the fat pointer. Note that it is the first field. */ - tem - = gnat_to_gnu_component_type (gnat_entity, definition, debug_info_p); + /* Now build the array type. */ /* If Component_Size is not already specified, annotate it with the size of the component. */ if (Unknown_Component_Size (gnat_entity)) - Set_Component_Size (gnat_entity, annotate_value (TYPE_SIZE (tem))); + Set_Component_Size (gnat_entity, + annotate_value (TYPE_SIZE (comp_type))); /* Compute the maximum size of the array in units and bits. */ if (gnu_max_size) { gnu_max_size_unit = size_binop (MULT_EXPR, gnu_max_size, - TYPE_SIZE_UNIT (tem)); + TYPE_SIZE_UNIT (comp_type)); gnu_max_size = size_binop (MULT_EXPR, convert (bitsizetype, gnu_max_size), - TYPE_SIZE (tem)); + TYPE_SIZE (comp_type)); } else gnu_max_size_unit = NULL_TREE; /* Now build the array type. */ + tem = comp_type; for (index = ndim - 1; index >= 0; index--) { tem = build_nonshared_array_type (tem, gnu_index_types[index]); |
