summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_dist.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-30 10:24:17 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-30 10:24:17 +0000
commit14cf7fa74a95f3bf6fe4808dfaa24f1676e1ecd0 (patch)
tree9d6cf6a29c0a1bdac65791a5798295c1f978b73b /gcc/ada/sem_dist.adb
parent7e7baeb5751f0ed6bcd4f750fa5ccd9398206baa (diff)
downloadgcc-14cf7fa74a95f3bf6fe4808dfaa24f1676e1ecd0.tar.gz
2012-01-30 Robert Dewar <dewar@adacore.com>
* a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb: Minor reformatting. 2012-01-30 Olivier Hainque <hainque@adacore.com> * sigtramp-ppcvxw.c (CFI_COMMON_REGS): Add rule for r1 back + comments. 2012-01-30 Thomas Quinot <quinot@adacore.com> * gnat_rm.texi, sem_dist.adb, sem_dist.ads, einfo.ads, sem_prag.adb, sem_ch12.adb, sem_attr.adb, aspects.adb, aspects.ads, par-prag.adb, sem_cat.adb, snames.ads-tmpl (Sem_Dist.Is_Valid_Remote_Object_Type): New subprogram (extracted from Sem_Cat.Validate_Remote_Access_Object_Type_Declaration). (Einfo.Is_Remote_Types): Now applies to generic types. Update documentation accordingly. (Sem_Ch12.Analyze_Associations): A RACW type is acceptable as actual for a formal type to which a pragma Remote_Access_Type applies. (Aspects, Par.Prag, Sem_Prag): Support for new pramga/aspect Remote_Access_Type. (Sem_Attr.Analyze_Attribute, case Stub_Type): Attribute can be applied to a generic type if pragma Remote_Access_Type applies, in which case the type of the attribute is System.Partition_Interface.RACW_Stub_Type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183698 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_dist.adb')
-rw-r--r--gcc/ada/sem_dist.adb46
1 files changed, 45 insertions, 1 deletions
diff --git a/gcc/ada/sem_dist.adb b/gcc/ada/sem_dist.adb
index f30e55d315c..072efa28ace 100644
--- a/gcc/ada/sem_dist.adb
+++ b/gcc/ada/sem_dist.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -287,6 +287,50 @@ package body Sem_Dist is
end case;
end Is_RACW_Stub_Type_Operation;
+ ---------------------------------
+ -- Is_Valid_Remote_Object_Type --
+ ---------------------------------
+
+ function Is_Valid_Remote_Object_Type (E : Entity_Id) return Boolean is
+ P : constant Node_Id := Parent (E);
+
+ begin
+ pragma Assert (Is_Tagged_Type (E));
+
+ -- Simple case: a limited private type
+
+ if Nkind (P) = N_Private_Type_Declaration
+ and then Is_Limited_Record (E)
+ then
+ return True;
+
+ -- AI05-0060 (Binding Interpretation): A limited interface is a legal
+ -- ancestor for the designated type of an RACW type.
+
+ elsif Is_Limited_Record (E) and then Is_Limited_Interface (E) then
+ return True;
+
+ -- A generic tagged limited type is a valid candidate. Limitedness will
+ -- be checked again on the actual at instantiation point.
+
+ elsif Nkind (P) = N_Formal_Type_Declaration
+ and then Ekind (E) = E_Record_Type_With_Private
+ and then Is_Generic_Type (E)
+ and then Is_Limited_Record (E)
+ then
+ return True;
+
+ -- A private extension declaration is a valid candidate if its parent
+ -- type is.
+
+ elsif Nkind (P) = N_Private_Extension_Declaration then
+ return Is_Valid_Remote_Object_Type (Etype (E));
+
+ else
+ return False;
+ end if;
+ end Is_Valid_Remote_Object_Type;
+
------------------------------------
-- Package_Specification_Of_Scope --
------------------------------------