From a8e05f922a087f545fb94f16687ec59b7d3dcdf5 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 22 Apr 2009 07:57:09 +0000 Subject: 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. : Directly use Esize for the type's precision. : For an unconstrained designated type, do not pretend that a dummy type is always made. 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 --- gcc/ada/gcc-interface/utils.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 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 c1af571..5e71343 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -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 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 @@ -1540,22 +1540,19 @@ create_field_decl (tree field_name, tree field_type, tree record_type, return field_decl; } -/* Returns a PARM_DECL node. PARAM_NAME is the name of the parameter, - PARAM_TYPE is its type. READONLY is true if the parameter is - readonly (either an In parameter or an address of a pass-by-ref - 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 readonly + (either an In parameter or an address of a pass-by-ref parameter). */ tree create_param_decl (tree param_name, tree param_type, bool readonly) { tree param_decl = build_decl (PARM_DECL, param_name, param_type); - /* Honor targetm.calls.promote_prototypes(), as not doing so can - lead to various ABI violations. */ - if (targetm.calls.promote_prototypes (param_type) - && (TREE_CODE (param_type) == INTEGER_TYPE - || TREE_CODE (param_type) == ENUMERAL_TYPE - || TREE_CODE (param_type) == BOOLEAN_TYPE) + /* Honor TARGET_PROMOTE_PROTOTYPES like the C compiler, as not doing so + can lead to various ABI violations. */ + if (targetm.calls.promote_prototypes (NULL_TREE) + && INTEGRAL_TYPE_P (param_type) && TYPE_PRECISION (param_type) < TYPE_PRECISION (integer_type_node)) { /* We have to be careful about biased types here. Make a subtype -- cgit v1.1