aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch13.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-30 12:29:48 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-30 12:29:48 +0200
commit2f6f8285368749fd716178f92e3131d003b6a18c (patch)
tree62bf2a238524092997d4163a063e79d7d18c3ce7 /gcc/ada/sem_ch13.adb
parentac43e11e234201441e84b5bc015587ecfff6c797 (diff)
downloadgcc-2f6f8285368749fd716178f92e3131d003b6a18c.zip
gcc-2f6f8285368749fd716178f92e3131d003b6a18c.tar.gz
gcc-2f6f8285368749fd716178f92e3131d003b6a18c.tar.bz2
[multiple changes]
2014-07-30 Hristian Kirtchev <kirtchev@adacore.com> * 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 <rybin@adacore.com frybin> * gnat_ugn.texi, vms_data.ads: gnatstub: describe generating subunits for body stubs. 2014-07-30 Pascal Obry <obry@adacore.com> * g-forstr.adb, g-forstr.ads: New. * gnat_rm.texi, impunit.adb Makefile.rtl: Add new unit GNAT.Formatted_String. From-SVN: r213241
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r--gcc/ada/sem_ch13.adb40
1 files changed, 38 insertions, 2 deletions
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;