diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-03-26 10:18:54 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-03-26 10:18:54 +0000 |
commit | 51c7954daf0d223599ad0aeea64b63816ee1e354 (patch) | |
tree | 5584c686f2c797da62ca728685356ce85163698f /gcc/ada/gcc-interface/decl.c | |
parent | 6ddf9843628ab87261d2ec8dc3d14ac057e76014 (diff) | |
download | gcc-51c7954daf0d223599ad0aeea64b63816ee1e354.zip gcc-51c7954daf0d223599ad0aeea64b63816ee1e354.tar.gz gcc-51c7954daf0d223599ad0aeea64b63816ee1e354.tar.bz2 |
decl.c (gnat_to_gnu_entity): Create TYPE_DECL for the padded type built to support a specified size or alignment.
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Create TYPE_DECL
for the padded type built to support a specified size or alignment.
From-SVN: r171554
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index d3d2b96..cea8d3d 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -911,9 +911,20 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) size of the object. */ gnu_object_size = gnu_size ? gnu_size : TYPE_SIZE (gnu_type); if (gnu_size || align > 0) - gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity, - false, false, definition, - gnu_size ? true : false); + { + tree orig_type = gnu_type; + + gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity, + false, false, definition, + gnu_size ? true : false); + + /* If a padding record was made, declare it now since it will + never be declared otherwise. This is necessary to ensure + that its subtrees are properly marked. */ + if (gnu_type != orig_type && !DECL_P (TYPE_NAME (gnu_type))) + create_type_decl (TYPE_NAME (gnu_type), gnu_type, NULL, true, + debug_info_p, gnat_entity); + } /* If this is a renaming, avoid as much as possible to create a new object. However, in several cases, creating it is required. |