aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-04-13 07:21:15 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-04-13 07:21:15 +0000
commit76af763dfeb704b85edf79c87dfda0cead34d698 (patch)
tree4257299e64b5687a21f011613e5caeb13a2139dc /gcc/ada/gcc-interface/decl.c
parentcb3d597d15475a12d37a3c01dc7f8e12d2c9eff1 (diff)
downloadgcc-76af763dfeb704b85edf79c87dfda0cead34d698.zip
gcc-76af763dfeb704b85edf79c87dfda0cead34d698.tar.gz
gcc-76af763dfeb704b85edf79c87dfda0cead34d698.tar.bz2
gigi.h (standard_datatypes): Add ADT_parent_name_id.
* gcc-interface/gigi.h (standard_datatypes): Add ADT_parent_name_id. (parent_name_id): New macro. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Use it. * gcc-interface/trans.c (gigi): Initialize it. (lvalue_required_p) <N_Type_Conversion>: New case. <N_Qualified_Expression>: Likewise. <N_Allocator>: Likewise. * gcc-interface/utils.c (convert): Try to properly upcast tagged types. From-SVN: r158255
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index a333170..190aec6 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -2851,8 +2851,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* ...and reference the _Parent field of this record. */
gnu_field
- = create_field_decl (get_identifier
- (Get_Name_String (Name_uParent)),
+ = create_field_decl (parent_name_id,
gnu_parent, gnu_type, 0,
has_rep
? TYPE_SIZE (gnu_parent) : NULL_TREE,
@@ -4392,6 +4391,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
handling alignment and possible padding. */
if (is_type && (!gnu_decl || this_made_decl))
{
+ /* Tell the middle-end that objects of tagged types are guaranteed to
+ be properly aligned. This is necessary because conversions to the
+ class-wide type are translated into conversions to the root type,
+ which can be less aligned than some of its derived types. */
if (Is_Tagged_Type (gnat_entity)
|| Is_Class_Wide_Equivalent_Type (gnat_entity))
TYPE_ALIGN_OK (gnu_type) = 1;