From 0fb2335d4ccfbc928951ddeba5ead045a1dff172 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 22 Apr 2009 07:28:48 +0000 Subject: fe.h (Get_External_Name): Declare. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fe.h (Get_External_Name): Declare. * gcc-interface/gigi.h (concat_id_with_name): Rename to... (concat_name): ...this. * gcc-interface/decl.c (gnat_to_gnu_entity): Rename gnu_entity_id to gnu_entity_name and adjust for above renaming. : Use create_concat_name to get the name of the various types associated with unconstrained array types. (make_aligning_type): Adjust for above renaming. (maybe_pad_type): Likewise. (components_to_record): Likewise.  Use get_identifier_with_length for the encoding of the variant. (get_entity_name): Use get_identifier_with_length. (create_concat_name): Likewise.  Use Get_External_Name if no suffix. Do not fiddle with Name_Buffer. (concat_id_with_name): Rename to... (concat_name): ...this.  Use get_identifier_with_length.  Do not fiddle with Name_Buffer. * gcc-interface/utils.c (rest_of_record_type_compilation): Adjust for above renaming. From-SVN: r146547 --- gcc/ada/gcc-interface/utils.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'gcc/ada/gcc-interface/utils.c') diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 3375c40..c1af571 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -802,22 +802,20 @@ rest_of_record_type_compilation (tree record_type) tree new_record_type = make_node (TREE_CODE (record_type) == QUAL_UNION_TYPE ? UNION_TYPE : TREE_CODE (record_type)); - tree orig_name = TYPE_NAME (record_type); - tree orig_id - = (TREE_CODE (orig_name) == TYPE_DECL ? DECL_NAME (orig_name) - : orig_name); - tree new_id - = concat_id_with_name (orig_id, - TREE_CODE (record_type) == QUAL_UNION_TYPE - ? "XVU" : "XVE"); + tree orig_name = TYPE_NAME (record_type), new_name; tree last_pos = bitsize_zero_node; - tree old_field; - tree prev_old_field = 0; + tree old_field, prev_old_field = NULL_TREE; - TYPE_NAME (new_record_type) = new_id; + if (TREE_CODE (orig_name) == TYPE_DECL) + orig_name = DECL_NAME (orig_name); + + new_name + = concat_name (orig_name, TREE_CODE (record_type) == QUAL_UNION_TYPE + ? "XVU" : "XVE"); + TYPE_NAME (new_record_type) = new_name; TYPE_ALIGN (new_record_type) = BIGGEST_ALIGNMENT; TYPE_STUB_DECL (new_record_type) - = create_type_stub_decl (new_id, new_record_type); + = create_type_stub_decl (new_name, new_record_type); DECL_IGNORED_P (TYPE_STUB_DECL (new_record_type)) = DECL_IGNORED_P (TYPE_STUB_DECL (record_type)); TYPE_SIZE (new_record_type) = size_int (TYPE_ALIGN (record_type)); @@ -937,7 +935,7 @@ rest_of_record_type_compilation (tree record_type) else strcpy (suffix, "XVL"); - field_name = concat_id_with_name (field_name, suffix); + field_name = concat_name (field_name, suffix); } new_field = create_field_decl (field_name, field_type, -- cgit v1.1