diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-04-22 07:28:48 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-04-22 07:28:48 +0000 |
commit | 0fb2335d4ccfbc928951ddeba5ead045a1dff172 (patch) | |
tree | 950ce5c9336788a41cdb4bf91464fab566a2861b /gcc/ada/gcc-interface/utils.c | |
parent | 8ff1dd836408a49359dbac9321678ccf6d33a6f9 (diff) | |
download | gcc-0fb2335d4ccfbc928951ddeba5ead045a1dff172.zip gcc-0fb2335d4ccfbc928951ddeba5ead045a1dff172.tar.gz gcc-0fb2335d4ccfbc928951ddeba5ead045a1dff172.tar.bz2 |
fe.h (Get_External_Name): Declare.
* 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.
<E_Access_Type>: 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
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 24 |
1 files changed, 11 insertions, 13 deletions
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, |