Commit 0fb2335d by Eric Botcazou Committed by Eric Botcazou

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
parent 8ff1dd83
2009-04-22 Eric Botcazou <ebotcazou@adacore.com>
* 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.
2009-04-21 Joseph Myers <joseph@codesourcery.com> 2009-04-21 Joseph Myers <joseph@codesourcery.com>
* ChangeLog, ChangeLog.ptr, ChangeLog.tree-ssa: Add copyright and * ChangeLog, ChangeLog.ptr, ChangeLog.tree-ssa: Add copyright and
......
...@@ -135,10 +135,12 @@ extern void Setup_Asm_Outputs (Node_Id); ...@@ -135,10 +135,12 @@ extern void Setup_Asm_Outputs (Node_Id);
/* exp_dbug: */ /* exp_dbug: */
#define Get_Encoded_Name exp_dbug__get_encoded_name #define Get_Encoded_Name exp_dbug__get_encoded_name
#define Get_External_Name exp_dbug__get_external_name
#define Get_External_Name_With_Suffix exp_dbug__get_external_name_with_suffix #define Get_External_Name_With_Suffix exp_dbug__get_external_name_with_suffix
extern void Get_Encoded_Name (Entity_Id); extern void Get_Encoded_Name (Entity_Id);
extern void Get_External_Name_With_Suffix (Entity_Id, Fat_Pointer); extern void Get_External_Name (Entity_Id, Boolean);
extern void Get_External_Name_With_Suffix (Entity_Id, Fat_Pointer);
/* lib: */ /* lib: */
......
...@@ -168,20 +168,21 @@ extern tree substitute_in_type (tree t, tree f, tree r); ...@@ -168,20 +168,21 @@ extern tree substitute_in_type (tree t, tree f, tree r);
needed to represent the object. */ needed to represent the object. */
extern tree rm_size (tree gnu_type); extern tree rm_size (tree gnu_type);
/* Given GNU_ID, an IDENTIFIER_NODE containing a name, and SUFFIX, a
string, return a new IDENTIFIER_NODE that is the concatenation of
the name in GNU_ID and SUFFIX. */
extern tree concat_id_with_name (tree gnu_id, const char *suffix);
/* Return the name to be used for GNAT_ENTITY. If a type, create a /* Return the name to be used for GNAT_ENTITY. If a type, create a
fully-qualified name, possibly with type information encoding. fully-qualified name, possibly with type information encoding.
Otherwise, return the name. */ Otherwise, return the name. */
extern tree get_entity_name (Entity_Id gnat_entity); extern tree get_entity_name (Entity_Id gnat_entity);
/* Return a name for GNAT_ENTITY concatenated with two underscores and /* Return an identifier representing the external name to be used for
SUFFIX. */ GNAT_ENTITY. If SUFFIX is specified, the name is followed by "___"
and the specified suffix. */
extern tree create_concat_name (Entity_Id gnat_entity, const char *suffix); extern tree create_concat_name (Entity_Id gnat_entity, const char *suffix);
/* Given GNU_NAME, an IDENTIFIER_NODE containing a name and SUFFIX, a
string, return a new IDENTIFIER_NODE that is the concatenation of
the name followed by "___" and the specified suffix. */
extern tree concat_name (tree gnu_name, const char *suffix);
/* If true, then gigi is being called on an analyzed but unexpanded tree, and /* If true, then gigi is being called on an analyzed but unexpanded tree, and
the only purpose of the call is to properly annotate types with the only purpose of the call is to properly annotate types with
representation information. */ representation information. */
......
...@@ -802,22 +802,20 @@ rest_of_record_type_compilation (tree record_type) ...@@ -802,22 +802,20 @@ rest_of_record_type_compilation (tree record_type)
tree new_record_type tree new_record_type
= make_node (TREE_CODE (record_type) == QUAL_UNION_TYPE = make_node (TREE_CODE (record_type) == QUAL_UNION_TYPE
? UNION_TYPE : TREE_CODE (record_type)); ? UNION_TYPE : TREE_CODE (record_type));
tree orig_name = TYPE_NAME (record_type); tree orig_name = TYPE_NAME (record_type), new_name;
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 last_pos = bitsize_zero_node; tree last_pos = bitsize_zero_node;
tree old_field; tree old_field, prev_old_field = NULL_TREE;
tree prev_old_field = 0;
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_ALIGN (new_record_type) = BIGGEST_ALIGNMENT;
TYPE_STUB_DECL (new_record_type) 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 (new_record_type))
= DECL_IGNORED_P (TYPE_STUB_DECL (record_type)); = DECL_IGNORED_P (TYPE_STUB_DECL (record_type));
TYPE_SIZE (new_record_type) = size_int (TYPE_ALIGN (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) ...@@ -937,7 +935,7 @@ rest_of_record_type_compilation (tree record_type)
else else
strcpy (suffix, "XVL"); 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, new_field = create_field_decl (field_name, field_type,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment