diff options
author | Steve Baird <baird@adacore.com> | 2020-02-20 15:35:51 -0800 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-08 03:51:16 -0400 |
commit | 48b799ea9a6a252c355947f33f78f43a38fe31b0 (patch) | |
tree | b98b7831933ddca88ef4e76e21e48a964b6175d4 /gcc | |
parent | 63408d0eb2f6fd33b6b423396e3d80d54f3235ae (diff) | |
download | gcc-48b799ea9a6a252c355947f33f78f43a38fe31b0.zip gcc-48b799ea9a6a252c355947f33f78f43a38fe31b0.tar.gz gcc-48b799ea9a6a252c355947f33f78f43a38fe31b0.tar.bz2 |
[Ada] Implement AI12-0073 (Ravenscar disallows Synchronous_Barriers)
2020-06-08 Steve Baird <baird@adacore.com>
gcc/ada/
* sem_prag.adb (Analyze_Pragma.Set_Ravenscar_Profile): Add
appropriate call to Set_Restriction_No_Dependence if Ada_Version
>= Ada2012 and Profile is either Ravenscar or a GNAT-defined
Ravenscar variant (i.e., not Jorvik).
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_prag.adb | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 269cbbb..8040374 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -11283,10 +11283,6 @@ package body Sem_Prag is -- No_Dependence => Ada.Execution_Time.Group_Budget -- No_Dependence => Ada.Execution_Time.Timers - -- ??? Eventually when AI12-0073 is implemented, we'll register a - -- No_Dependence restriction on Ada.Synchronous_Barriers - -- for Ravenscar but not for Jorvik. - if Ada_Version >= Ada_2005 then Pref_Id := Make_Identifier (Loc, Name_Find ("ada")); Sel_Id := Make_Identifier (Loc, Name_Find ("execution_time")); @@ -11325,7 +11321,7 @@ package body Sem_Prag is end if; -- Set the following restriction which was added to Ada 2012 (see - -- AI-0171): + -- AI05-0171): -- No_Dependence => System.Multiprocessors.Dispatching_Domains if Ada_Version >= Ada_2012 then @@ -11350,7 +11346,32 @@ package body Sem_Prag is (Unit => Nod, Warn => Treat_Restrictions_As_Warnings, Profile => Ravenscar); + + -- Set the following restriction which was added to Ada 2020, + -- but as a binding interpretation: + -- No_Dependence => Ada.Synchronous_Barriers + -- for Ravenscar (and therefore for Ravenscar variants) but not + -- for Jorvik. The unit Ada.Synchronous_Barriers was introduced + -- in Ada2012 (AI05-0174). + + if Profile /= Jorvik then + Pref_Id := Make_Identifier (Loc, Name_Find ("ada")); + Sel_Id := Make_Identifier (Loc, Name_Find + ("synchronous_barriers")); + + Nod := + Make_Selected_Component + (Sloc => Loc, + Prefix => Pref_Id, + Selector_Name => Sel_Id); + + Set_Restriction_No_Dependence + (Unit => Nod, + Warn => Treat_Restrictions_As_Warnings, + Profile => Ravenscar); + end if; end if; + end Set_Ravenscar_Profile; -- Start of processing for Analyze_Pragma |