aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2017-05-22 09:38:09 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-05-22 09:38:09 +0000
commitfbb1c7d4a061ae0f57d52b37ddf37933da859945 (patch)
treee5b3b25705b1cb6996e6c1a91d7f490de80156c9 /gcc/ada/gcc-interface/decl.c
parent61890ff25a24b2ddb289c61c1e5fbcae6f9f613d (diff)
downloadgcc-fbb1c7d4a061ae0f57d52b37ddf37933da859945.zip
gcc-fbb1c7d4a061ae0f57d52b37ddf37933da859945.tar.gz
gcc-fbb1c7d4a061ae0f57d52b37ddf37933da859945.tar.bz2
decl.c (gnat_to_gnu_entity): Skip regular processing for Itypes that are E_Access_Subtype.
* gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing for Itypes that are E_Access_Subtype. <E_Access_Subtype>: Use the DECL of the base type directly. From-SVN: r248323
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 91a03cd..eab244e 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -310,11 +310,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
/* Contains the list of attributes directly attached to the entity. */
struct attrib *attr_list = NULL;
- /* Since a use of an Itype is a definition, process it as such if it
- is not in a with'ed unit. */
+ /* 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. */
if (!definition
&& is_type
&& Is_Itype (gnat_entity)
+ && Ekind (gnat_entity) != E_Access_Subtype
&& !present_gnu_tree (gnat_entity)
&& In_Extended_Main_Code_Unit (gnat_entity))
{
@@ -3823,7 +3825,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
case E_Access_Subtype:
/* We treat this as identical to its base type; any constraint is
meaningful only to the front-end. */
- gnu_type = gnat_to_gnu_type (Etype (gnat_entity));
+ gnu_decl = gnat_to_gnu_entity (Etype (gnat_entity), NULL_TREE, false);
+ saved = true;
/* The designated subtype must be elaborated as well, if it does
not have its own freeze node. But designated subtypes created
@@ -3855,8 +3858,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
gnat_to_gnu_entity (Directly_Designated_Type (gnat_entity),
NULL_TREE, false);
}
-
- maybe_present = true;
break;
/* Subprogram Entities