Commit a8e05f92 by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Compute is_type predicate on entry.

	* gcc-interface/decl.c (gnat_to_gnu_entity): Compute is_type predicate
	on entry.  Defer common processing for types.  Reorder and clean up.
	Compute the equivalent GNAT node and the default size for types only.
	<E_Modular_Integer_Type>: Directly use Esize for the type's precision.
	<E_Access_Type>: For an unconstrained designated type, do not pretend
	that a dummy type is always made.
	<all> Fix nits in comments.
	(validate_size): Fix formatting nits and comments.
	(set_rm_size): Likewise.
	* gcc-interface/utils.c (create_param_decl): Replace bogus argument
	passed to TARGET_PROMOTE_PROTOTYPES hook.

From-SVN: r146549
parent 3ad606bc
2009-04-22 Eric Botcazou <ebotcazou@adacore.com> 2009-04-22 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): Compute is_type predicate
on entry. Defer common processing for types. Reorder and clean up.
Compute the equivalent GNAT node and the default size for types only.
<E_Modular_Integer_Type>: Directly use Esize for the type's precision.
<E_Access_Type>: For an unconstrained designated type, do not pretend
that a dummy type is always made.
<all> Fix nits in comments.
(validate_size): Fix formatting nits and comments.
(set_rm_size): Likewise.
* gcc-interface/utils.c (create_param_decl): Replace bogus argument
passed to TARGET_PROMOTE_PROTOTYPES hook.
2009-04-22 Eric Botcazou <ebotcazou@adacore.com>
* fe.h (Get_External_Name): Declare. * fe.h (Get_External_Name): Declare.
* gcc-interface/gigi.h (concat_id_with_name): Rename to... * gcc-interface/gigi.h (concat_id_with_name): Rename to...
(concat_name): ...this. (concat_name): ...this.
...@@ -9,13 +23,13 @@ ...@@ -9,13 +23,13 @@
types associated with unconstrained array types. types associated with unconstrained array types.
(make_aligning_type): Adjust for above renaming. (make_aligning_type): Adjust for above renaming.
(maybe_pad_type): Likewise. (maybe_pad_type): Likewise.
(components_to_record): Likewise.  Use get_identifier_with_length for (components_to_record): Likewise. Use get_identifier_with_length for
the encoding of the variant. the encoding of the variant.
(get_entity_name): Use get_identifier_with_length. (get_entity_name): Use get_identifier_with_length.
(create_concat_name): Likewise.  Use Get_External_Name if no suffix. (create_concat_name): Likewise. Use Get_External_Name if no suffix.
Do not fiddle with Name_Buffer. Do not fiddle with Name_Buffer.
(concat_id_with_name): Rename to... (concat_id_with_name): Rename to...
(concat_name): ...this.  Use get_identifier_with_length.  Do not fiddle (concat_name): ...this. Use get_identifier_with_length. Do not fiddle
with Name_Buffer. with Name_Buffer.
* gcc-interface/utils.c (rest_of_record_type_compilation): Adjust for * gcc-interface/utils.c (rest_of_record_type_compilation): Adjust for
above renaming. above renaming.
......
...@@ -1397,7 +1397,7 @@ aggregate_type_contains_array_p (tree type) ...@@ -1397,7 +1397,7 @@ aggregate_type_contains_array_p (tree type)
} }
} }
/* Returns a FIELD_DECL node. FIELD_NAME the field name, FIELD_TYPE is its /* Return a FIELD_DECL node. FIELD_NAME the field name, FIELD_TYPE is its
type, and RECORD_TYPE is the type of the parent. PACKED is nonzero if type, and RECORD_TYPE is the type of the parent. PACKED is nonzero if
this field is in a record type with a "pragma pack". If SIZE is nonzero this field is in a record type with a "pragma pack". If SIZE is nonzero
it is the specified size for this field. If POS is nonzero, it is the bit it is the specified size for this field. If POS is nonzero, it is the bit
...@@ -1540,22 +1540,19 @@ create_field_decl (tree field_name, tree field_type, tree record_type, ...@@ -1540,22 +1540,19 @@ create_field_decl (tree field_name, tree field_type, tree record_type,
return field_decl; return field_decl;
} }
/* Returns a PARM_DECL node. PARAM_NAME is the name of the parameter, /* Return a PARM_DECL node. PARAM_NAME is the name of the parameter and
PARAM_TYPE is its type. READONLY is true if the parameter is PARAM_TYPE is its type. READONLY is true if the parameter is readonly
readonly (either an In parameter or an address of a pass-by-ref (either an In parameter or an address of a pass-by-ref parameter). */
parameter). */
tree tree
create_param_decl (tree param_name, tree param_type, bool readonly) create_param_decl (tree param_name, tree param_type, bool readonly)
{ {
tree param_decl = build_decl (PARM_DECL, param_name, param_type); tree param_decl = build_decl (PARM_DECL, param_name, param_type);
/* Honor targetm.calls.promote_prototypes(), as not doing so can /* Honor TARGET_PROMOTE_PROTOTYPES like the C compiler, as not doing so
lead to various ABI violations. */ can lead to various ABI violations. */
if (targetm.calls.promote_prototypes (param_type) if (targetm.calls.promote_prototypes (NULL_TREE)
&& (TREE_CODE (param_type) == INTEGER_TYPE && INTEGRAL_TYPE_P (param_type)
|| TREE_CODE (param_type) == ENUMERAL_TYPE
|| TREE_CODE (param_type) == BOOLEAN_TYPE)
&& TYPE_PRECISION (param_type) < TYPE_PRECISION (integer_type_node)) && TYPE_PRECISION (param_type) < TYPE_PRECISION (integer_type_node))
{ {
/* We have to be careful about biased types here. Make a subtype /* We have to be careful about biased types here. Make a subtype
......
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