From 24c8d764579e0bc9d66d96b1ff0c27fe5c22afb8 Mon Sep 17 00:00:00 2001 From: charlet Date: Tue, 26 May 2015 10:29:25 +0000 Subject: 2015-05-26 Robert Dewar * sem_aggr.adb (Resolve_Array_Aggregate): Defend against bad bounds. * debug.adb: Document -gnatd.k. * erroutc.adb (Set_Msg_Insertion_Line_Number): Implement -gnatd.k. 2015-05-26 Robert Dewar * gnat1drv.adb (Gnat1drv): Provide new arguments for Get_Target_Parameters. * restrict.adb (Set_Restriction_No_Specification_Of_Aspect): new procedure. (Set_Restriction_No_Use_Of_Attribute): new procedure. * restrict.ads (Set_Restriction_No_Specification_Of_Aspect): new procedure. (Set_Restriction_No_Use_Of_Attribute): new procedure. * s-rident.ads (Integer_Parameter_Restrictions): New subtype. * targparm.adb (Get_Target_Parameters): Allow new restriction pragmas No_Specification_Of_Aspect No_Use_Of_Attribute No_Use_Of_Pragma. * targparm.ads: New parameters for Get_Target_Parameters. * tbuild.adb (Set_NOD): New name for Set_RND. (Set_NSA): New procedure. (Set_NUA): New procedure. (Set_NUP): New procedure. * tbuild.ads (Make_SC): Minor reformatting. (Set_NOD): New name for Set_RND. (Set_NSA, Set_NUA, Set_NUP): New procedure. 2015-05-26 Ed Schonberg * a-stwise.adb (Find_Token): If source'first is not positive, an exception must be raised, as specified by RM 2005 A.4.3 (68/1). This must be checked explicitly, given that run-time files are normally compiled without constraint checks. * a-stzsea.adb (Find_Token): Ditto. 2015-05-26 Ed Schonberg * sem_util.ads sem_util.adb (Is_Current_Instance): New predicate to fully implement RM 8.6 (17/3). which earlier only applied to synchronized types. Used to preanalyze aspects that include current instances of types, such as Predicate and Invariant. * sem_res.adb (Resolve_Entity_Name): Use Is_Current_Instance. * sem_ch13.adb (Add_Predicates): In ASIS mode, preserve original expression of aspect and analyze it to provide proper type information. 2015-05-26 Robert Dewar * rtsfind.ads: Add entries for RE_Exn[_Long]_Float. * s-exnllf.adb (Exn_Float): New function. (Exn_Long_Float): New function. (Exn_Long_Long_Float): Rewritten interface. (Exp): New name for what used to be Exn_Long_Long_Float. * s-exnllf.ads (Exn_Float): New function. (Exn_Long_Float): New function. 2015-05-26 Ed Schonberg * sem_ch8.adb (Find_Selected_Component): Do not emit an error on a selected component when the prefix is a type name that is a Current_Instance. * einfo.ads: Minor grammar fix. 2015-05-26 Doug Rupp * init.c [vxworks] (sysLib.h): Only for x86. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223678 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_util.adb | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'gcc/ada/sem_util.adb') diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index b2f6a5727da..0a5c8a4b3c0 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -10951,6 +10951,46 @@ package body Sem_Util is and then Is_Imported (Entity (Name (N))); end Is_CPP_Constructor_Call; + ------------------------- + -- Is_Current_Instance -- + ------------------------- + + function Is_Current_Instance (N : Node_Id) return Boolean is + Typ : constant Entity_Id := Entity (N); + P : Node_Id; + + begin + -- Simplest case : entity is a concurrent type and we are currently + -- inside the body. This will eventually be expanded into a + -- call to Self (for tasks) or _object (for protected objects). + + if Is_Concurrent_Type (Typ) and then In_Open_Scopes (Typ) then + return True; + + else + -- Check whether the context is a (sub)type declaration for the + -- type entity. + + P := Parent (N); + while Present (P) loop + if Nkind_In (P, N_Full_Type_Declaration, + N_Private_Type_Declaration, + N_Subtype_Declaration) + and then Comes_From_Source (P) + and then Defining_Entity (P) = Typ + then + return True; + end if; + + P := Parent (P); + end loop; + end if; + + -- In any other context this is not a current occurence + + return False; + end Is_Current_Instance; + -------------------- -- Is_Declaration -- -------------------- -- cgit v1.2.1