aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-04-22 08:34:09 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-04-22 08:34:09 +0000
commitfeec4372c1d33b1d7de0442d9d6308c2b96255ca (patch)
treebc368177858013d50041be20988e8673b42cffe4 /gcc/ada/gcc-interface/utils.c
parent7d83f4f5362bb17aa3b53db60bed6dbb5cd38e73 (diff)
downloadgcc-feec4372c1d33b1d7de0442d9d6308c2b96255ca.zip
gcc-feec4372c1d33b1d7de0442d9d6308c2b96255ca.tar.gz
gcc-feec4372c1d33b1d7de0442d9d6308c2b96255ca.tar.bz2
ada-tree.def: Fix formatting nits.
* gcc-interface/ada-tree.def: Fix formatting nits. (REGION_STMT): Delete. (HANDLER_STMT): Likewise. * gcc-interface/ada-tree.h: Fix formatting nits. (IS_STMT): Delete. (REGION_STMT_BODY): Likewise. (REGION_STMT_HANDLE): Likewise. (REGION_STMT_BLOCK): Likewise. (HANDLER_STMT_ARG): Likewise. (HANDLER_STMT_LIST): Likewise. (HANDLER_STMT_BLOCK): Likewise. * gcc-interface/gigi.h (fp_prec_to_size): Update comment. (fp_size_to_prec): Likewise. (largest_move_alignment): Delete. (gnat_compute_largest_alignment): Likewise. Fix minor nits. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>: Remove redundant code. <E_Array_Type>: Remove redundant assert. <E_Array_Subtype>: Exit early from index computation in pathological cases. Rewrite conditional assignment. (make_type_from_size): Likewise. * gcc-interface/misc.c (largest_move_alignment): Delete. (gnat_finish_incomplete_decl): Likewise. (LANG_HOOKS_FINISH_INCOMPLETE_DECL): Likewise. (asm_out_file): Likewise (gnat_print_type) <INTEGER_TYPE>: Fall through to ENUMERAL_TYPE case. (gnat_dwarf_name): Move around. * gcc-interface/trans.c (Attribute_to_gnu): Fix minor nits. (gigi): Remove call to gnat_compute_largest_alignment. * utils.c (create_field_decl): Rewrite conditional assignment. Fix minor nits. From-SVN: r146551
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 5e71343..b2c4399 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1472,10 +1472,13 @@ create_field_decl (tree field_name, tree field_type, tree record_type,
DECL_BIT_FIELD (field_decl) = 1;
DECL_SIZE (field_decl) = size;
if (!packed && !pos)
- DECL_ALIGN (field_decl)
- = (TYPE_ALIGN (record_type) != 0
- ? MIN (TYPE_ALIGN (record_type), TYPE_ALIGN (field_type))
- : TYPE_ALIGN (field_type));
+ {
+ if (TYPE_ALIGN (record_type) != 0
+ && TYPE_ALIGN (record_type) < TYPE_ALIGN (field_type))
+ DECL_ALIGN (field_decl) = TYPE_ALIGN (record_type);
+ else
+ DECL_ALIGN (field_decl) = TYPE_ALIGN (field_type);
+ }
}
DECL_PACKED (field_decl) = pos ? DECL_BIT_FIELD (field_decl) : packed;
@@ -1636,7 +1639,7 @@ process_attributes (tree decl, struct attrib *attr_list)
}
}
-/* Record a global renaming pointer. */
+/* Record DECL as a global renaming pointer. */
void
record_global_renaming_pointer (tree decl)
@@ -4520,7 +4523,7 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
return expr;
}
-/* Return the appropriate GCC tree code for the specified GNAT type,
+/* Return the appropriate GCC tree code for the specified GNAT_TYPE,
the latter being a record type as predicated by Is_Record_Type. */
enum tree_code