diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-09-05 09:49:34 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-09-05 09:49:34 +0000 |
commit | 42f05e6e69e83a35f46858e17fcdab733bf82a9c (patch) | |
tree | 9dbdea9dd0c0d78bbf9a287cf9989cf4156f1889 /gcc/ada/gcc-interface/decl.c | |
parent | c3f9fde97b9f2f47259d4d1f96b6520f2f9355dd (diff) |
PR ada/62235
* gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
for Itypes that are E_Record_Subtype with a cloned subtype.
<E_Record_Subtype>: Use the DECL of the cloned type directly, if any.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@251707 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index ed8a50350741..3e0979625bc8 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -309,11 +309,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* Since a use of an Itype is a definition, process it as such if it is in the main unit, except for E_Access_Subtype because it's actually a use - of its base type, see below. */ + of its base type, and for E_Record_Subtype with cloned subtype because + it's actually a use of the cloned subtype, see below. */ if (!definition && is_type && Is_Itype (gnat_entity) - && Ekind (gnat_entity) != E_Access_Subtype + && !(kind == E_Access_Subtype + || (kind == E_Record_Subtype + && Present (Cloned_Subtype (gnat_entity)))) && !present_gnu_tree (gnat_entity) && In_Extended_Main_Code_Unit (gnat_entity)) { @@ -3391,7 +3394,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) { gnu_decl = gnat_to_gnu_entity (Cloned_Subtype (gnat_entity), NULL_TREE, false); - maybe_present = true; + saved = true; break; } |