diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-14 10:49:59 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-14 10:49:59 +0000 |
commit | caf125ce0eba2635836221d92bf855b233305f89 (patch) | |
tree | faeb8bf3d0b97c831e30b175c8171f08f0d0f8a7 /gcc/ada/sem_prag.adb | |
parent | 2fec2b516d3cc66554bf4d9c708cc0d9fbd66a69 (diff) | |
download | gcc-caf125ce0eba2635836221d92bf855b233305f89.tar.gz |
2012-06-14 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb, exp_util.adb, sem_aux.ads, exp_ch9.adb,
sem_ch10.adb, freeze.adb, sem_util.adb, exp_ch4.adb,
s-taprop-dummy.adb: Minor reformatting.
2012-06-14 Vincent Pucci <pucci@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Lock_Free
attribute case added.
* par-prag.adb (Prag): Lock_Free pragma case added.
* sem_attr.adb (Analyze_Attribute_Reference): Lock_Free attribute
case added.
* sem_ch13.adb (Analyze_Aspect_Specifications): Record_Rep_Item
call added for Aspect_Lock_Free.
* sem_ch9.adb (Allows_Lock_Free_Implementation): New Lock_Free
error messages for subprogram bodies.
(Lock_Free_Disabled): New routine.
(Analyze_Protected_Body): Call to Lock_Free_Disabled added.
* sem_prag.adb (Analyze_Pragma): Lock_Free pragma case added.
* snames.adb-tmpl (Get_Pragma_Id): Name_Lock_Free case added.
(Is_Pragma_Name): Name_Lock_Free case added.
* snames.ads-tmpl: Attribute_Lock_Free and Pragma_Lock_Free added.
2012-06-14 Ed Schonberg <schonberg@adacore.com>
* a-coorma.adb, a-cborma.adb, a-cbhama.adb, a-ciorma.adb: Add missing
aliased keyword.
2012-06-14 Bob Duff <duff@adacore.com>
* lib.ads, lib.adb, sem.adb (Write_Unit_Info): Move this
procedure from Sem body to Lib spec, so it can be used for
debugging elsewhere.
2012-06-14 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Check_Conformance): Add Ada 2012 check on mode
conformance: "aliased" must apply to both or neither formal
parameters.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188609 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r-- | gcc/ada/sem_prag.adb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 35e1f6404ee..8b2eb1c908c 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -11118,6 +11118,54 @@ package body Sem_Prag is when Pragma_List => null; + --------------- + -- Lock_Free -- + --------------- + + -- pragma Lock_Free [(Boolean_EXPRESSION)]; + + when Pragma_Lock_Free => Lock_Free : declare + P : constant Node_Id := Parent (N); + Arg : Node_Id; + Ent : Entity_Id; + Val : Boolean; + + begin + Check_No_Identifiers; + Check_At_Most_N_Arguments (1); + + -- Protected definition case + + if Nkind (P) = N_Protected_Definition then + Ent := Defining_Identifier (Parent (P)); + + -- One argument + + if Arg_Count = 1 then + Arg := Get_Pragma_Arg (Arg1); + Val := Is_True (Static_Boolean (Arg)); + + -- Zero argument. In this case the expression is considered to + -- be True. + + else + Val := True; + end if; + + -- Check duplicate pragma before we chain the pragma in the Rep + -- Item chain of Ent. + + Check_Duplicate_Pragma (Ent); + Record_Rep_Item (Ent, N); + Set_Uses_Lock_Free (Ent, Val); + + -- Anything else is incorrect + + else + Pragma_Misplaced; + end if; + end Lock_Free; + -------------------- -- Locking_Policy -- -------------------- @@ -15212,6 +15260,7 @@ package body Sem_Prag is Pragma_Linker_Options => -1, Pragma_Linker_Section => -1, Pragma_List => -1, + Pragma_Lock_Free => -1, Pragma_Locking_Policy => -1, Pragma_Long_Float => -1, Pragma_Machine_Attribute => -1, |