diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-04-22 07:57:09 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-04-22 07:57:09 +0000 |
commit | a8e05f922a087f545fb94f16687ec59b7d3dcdf5 (patch) | |
tree | 4d38300c733c45da31a1586e79179ec7f40fc2b0 /gcc/ada/gcc-interface/utils.c | |
parent | 3ad606bc1137d266e492308ba884474b69069a5b (diff) | |
download | gcc-a8e05f922a087f545fb94f16687ec59b7d3dcdf5.zip gcc-a8e05f922a087f545fb94f16687ec59b7d3dcdf5.tar.gz gcc-a8e05f922a087f545fb94f16687ec59b7d3dcdf5.tar.bz2 |
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
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 19 |
1 files changed, 8 insertions, 11 deletions
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 |