From 2f6f8285368749fd716178f92e3131d003b6a18c Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 30 Jul 2014 12:29:48 +0200 Subject: [multiple changes] 2014-07-30 Hristian Kirtchev * aspects.ads Aspects Async_Readers, Async_Writers, Effective_Reads and Effective_Writes do not need to be delayed. * sem_ch13.adb (Analyze_Aspect_Specifications): Propagate the optional Boolean expression when generating the corresponding pragma for an external property aspect. * sem_prag.adb (Analyze_External_Property_In_Decl_Part): Remove local constant Obj. Add local constant Obj_Id. Reimplement the check which ensures that the related variable is in fact volatile. (Analyze_Pragma): Reimplement the analysis of external property pragmas. * sem_util.adb (Is_Enabled): New routine. (Variable_Has_Enabled_Property): Reimplement the detection of an enabled external property. 2014-07-30 Sergey Rybin * gnat_ugn.texi, vms_data.ads: gnatstub: describe generating subunits for body stubs. 2014-07-30 Pascal Obry * g-forstr.adb, g-forstr.ads: New. * gnat_rm.texi, impunit.adb Makefile.rtl: Add new unit GNAT.Formatted_String. From-SVN: r213241 --- gcc/ada/sem_ch13.adb | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'gcc/ada/sem_ch13.adb') diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 6510372..6a8f336 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -2905,10 +2905,46 @@ package body Sem_Ch13 is goto Continue; end if; + -- External property aspects are Boolean by nature, but + -- their pragmas must contain two arguments, the second + -- being the optional Boolean expression. + + if A_Id = Aspect_Async_Readers + or else A_Id = Aspect_Async_Writers + or else A_Id = Aspect_Effective_Reads + or else A_Id = Aspect_Effective_Writes + then + declare + Args : List_Id; + + begin + -- The first argument of the external property pragma + -- is the related object. + + Args := New_List ( + Make_Pragma_Argument_Association (Sloc (Ent), + Expression => Ent)); + + -- The second argument is the optional Boolean + -- expression which must be propagated even if it + -- evaluates to False as this has special semantic + -- meaning. + + if Present (Expr) then + Append_To (Args, + Make_Pragma_Argument_Association (Loc, + Expression => Relocate_Node (Expr))); + end if; + + Make_Aitem_Pragma + (Pragma_Argument_Associations => Args, + Pragma_Name => Nam); + end; + -- Cases where we do not delay, includes all cases where -- the expression is missing other than the above cases. - if not Delay_Required or else No (Expr) then + elsif not Delay_Required or else No (Expr) then Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Sloc (Ent), @@ -2918,7 +2954,7 @@ package body Sem_Ch13 is -- In general cases, the corresponding pragma/attribute -- definition clause will be inserted later at the freezing - -- point, and we do not need to build it now + -- point, and we do not need to build it now. else Aitem := Empty; -- cgit v1.1