aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-02-29 18:28:41 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-02-29 18:28:41 +0000
commitfd7876407c7ff2ca489861538b886393a95efa8d (patch)
treed7a052206dec8e0150c21d87cffdc18eb54d0f4e /gcc/ada/gcc-interface/decl.c
parenta3017cf147db82ad86e5a81b9677e8ca8e29ead2 (diff)
downloadgcc-fd7876407c7ff2ca489861538b886393a95efa8d.zip
gcc-fd7876407c7ff2ca489861538b886393a95efa8d.tar.gz
gcc-fd7876407c7ff2ca489861538b886393a95efa8d.tar.bz2
dwarf2out.c (modified_type_die): Set DW_AT_GNAT_descriptive_type and DW_AT_artificial attributes at the end of...
* dwarf2out.c (modified_type_die): Set DW_AT_GNAT_descriptive_type and DW_AT_artificial attributes at the end of the processing. (gen_array_type_die): Likewise. (gen_enumeration_type_die): Likewise. (gen_struct_or_union_type_die): Likewise. (add_gnat_descriptive_type_attribute): Do not suppress debug info for the parent type. ada/ * gcc-interface/decl.c (components_to_record): Add ARTIFICIAL parameter and set TYPE_ARTIFICIAL according to it.  Adjust recursive call. (gnat_to_gnu_entity) <E_Record_Type>: Adjust call to above function. * gcc-interface/utils.c (rest_of_record_type_compilation): Do not invoke rest_of_type_decl_compilation on the parallel type, if any. From-SVN: r184667
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 80ad5a3..5b6d2f7 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -160,7 +160,7 @@ static bool compile_time_known_address_p (Node_Id);
static bool cannot_be_superflat_p (Node_Id);
static bool constructor_address_p (tree);
static void components_to_record (tree, Node_Id, tree, int, bool, bool, bool,
- bool, bool, bool, bool, tree, tree *);
+ bool, bool, bool, bool, bool, tree, tree *);
static Uint annotate_value (tree);
static void annotate_rep (Entity_Id, tree);
static tree build_position_list (tree, bool, tree, tree, unsigned int, tree);
@@ -3128,7 +3128,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Add the fields into the record type and finish it up. */
components_to_record (gnu_type, Component_List (record_definition),
gnu_field_list, packed, definition, false,
- all_rep, is_unchecked_union, debug_info_p,
+ all_rep, is_unchecked_union,
+ !Comes_From_Source (gnat_entity), debug_info_p,
false, OK_To_Reorder_Components (gnat_entity),
all_rep ? NULL_TREE : bitsize_zero_node, NULL);
@@ -7275,6 +7276,8 @@ compare_field_bitpos (const PTR rt1, const PTR rt2)
UNCHECKED_UNION is true if we are building this type for a record with a
Pragma Unchecked_Union.
+ ARTIFICIAL is true if this is a type that was generated by the compiler.
+
DEBUG_INFO is true if we need to write debug information about the type.
MAYBE_UNUSED is true if this type may be unused in the end; this doesn't
@@ -7294,8 +7297,8 @@ static void
components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
tree gnu_field_list, int packed, bool definition,
bool cancel_alignment, bool all_rep,
- bool unchecked_union, bool debug_info,
- bool maybe_unused, bool reorder,
+ bool unchecked_union, bool artificial,
+ bool debug_info, bool maybe_unused, bool reorder,
tree first_free_pos, tree *p_gnu_rep_list)
{
bool all_rep_and_size = all_rep && TYPE_SIZE (gnu_record_type);
@@ -7464,7 +7467,8 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
components_to_record (gnu_variant_type, Component_List (variant),
NULL_TREE, packed, definition,
!all_rep_and_size, all_rep, unchecked_union,
- debug_info, true, reorder, this_first_free_pos,
+ true, debug_info, true, reorder,
+ this_first_free_pos,
all_rep || this_first_free_pos
? NULL : &gnu_rep_list);
@@ -7706,7 +7710,10 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
TYPE_ALIGN (gnu_record_type) = 0;
finish_record_type (gnu_record_type, nreverse (gnu_field_list),
- layout_with_rep ? 1 : 0, debug_info && !maybe_unused);
+ layout_with_rep ? 1 : 0, false);
+ TYPE_ARTIFICIAL (gnu_record_type) = artificial;
+ if (debug_info && !maybe_unused)
+ rest_of_record_type_compilation (gnu_record_type);
}
/* Given GNU_SIZE, a GCC tree representing a size, return a Uint to be