diff options
author | Ed Schonberg <schonberg@adacore.com> | 2016-04-20 10:46:57 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-04-20 12:46:57 +0200 |
commit | f73dc37f756c3839704b24739e875f378edb9db4 (patch) | |
tree | d7d1bbe572ad92b1dc6a9f703757cda9068a237f | |
parent | 75a957f5dba310b73a1d040da70f6e4077379af4 (diff) | |
download | gcc-f73dc37f756c3839704b24739e875f378edb9db4.zip gcc-f73dc37f756c3839704b24739e875f378edb9db4.tar.gz gcc-f73dc37f756c3839704b24739e875f378edb9db4.tar.bz2 |
sem_util.ads, [...] (Is_Expanded_Priority_Attribute): New predicate to determine that in a context with full run-time...
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_util.ads, sem_util.adb (Is_Expanded_Priority_Attribute):
New predicate to determine that in a context with full run-time,
a function call is an expansion of a reference to attribute
Priority.
* sem_ch5.adb (Analyze_Function_Call): use it.
* exp_ch5.adb (Expand_N_Subprogram_Call): use it.
From-SVN: r235265
-rw-r--r-- | gcc/ada/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/ada/exp_ch5.adb | 8 | ||||
-rw-r--r-- | gcc/ada/sem_ch5.adb | 7 | ||||
-rw-r--r-- | gcc/ada/sem_util.adb | 13 | ||||
-rw-r--r-- | gcc/ada/sem_util.ads | 5 |
5 files changed, 30 insertions, 12 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b187ef1..b849645 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2016-04-20 Ed Schonberg <schonberg@adacore.com> + + * sem_util.ads, sem_util.adb (Is_Expanded_Priority_Attribute): + New predicate to determine that in a context with full run-time, + a function call is an expansion of a reference to attribute + Priority. + * sem_ch5.adb (Analyze_Function_Call): use it. + * exp_ch5.adb (Expand_N_Subprogram_Call): use it. + 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb Flag286 is now used as Is_Exception_Handler. diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index d7a0d9e..9f9c832 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -1695,12 +1695,8 @@ package body Exp_Ch5 is -- previously expanded into a call to the Get_Ceiling run-time -- subprogram. In restricted profiles this is not available. - if Nkind (Ent) = N_Function_Call - and then not Configurable_Run_Time_Mode - and then (Entity (Name (Ent)) = RTE (RE_Get_Ceiling) - or else - Entity (Name (Ent)) = RTE (RO_PE_Get_Ceiling)) - then + if Is_Expanded_Priority_Attribute (Ent) then + -- Look for the enclosing concurrent type Conctyp := Current_Scope; diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 1a9692c..71ab4d0 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -41,7 +41,6 @@ with Nmake; use Nmake; with Opt; use Opt; with Restrict; use Restrict; with Rident; use Rident; -with Rtsfind; use Rtsfind; with Sem; use Sem; with Sem_Aux; use Sem_Aux; with Sem_Case; use Sem_Case; @@ -440,11 +439,7 @@ package body Sem_Ch5 is -- objects have been previously expanded into calls to the -- Get_Ceiling run-time subprogram. - or else - (Nkind (Ent) = N_Function_Call - and then (Entity (Name (Ent)) = RTE (RE_Get_Ceiling) - or else - Entity (Name (Ent)) = RTE (RO_PE_Get_Ceiling))) + or else Is_Expanded_Priority_Attribute (Ent) then -- The enclosing subprogram cannot be a protected function diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 5f2722d..eaa2429 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -12123,6 +12123,19 @@ package body Sem_Util is and then Nkind (Unit_Declaration_Node (Id)) = N_Entry_Declaration; end Is_Entry_Declaration; + ------------------------------------ + -- Is_Expanded_Priority_Attribute -- + ------------------------------------ + + function Is_Expanded_Priority_Attribute (E : Entity_Id) return Boolean is + begin + return + Nkind (E) = N_Function_Call + and then not Configurable_Run_Time_Mode + and then (Entity (Name (E)) = RTE (RE_Get_Ceiling) + or else Entity (Name (E)) = RTE (RO_PE_Get_Ceiling)); + end Is_Expanded_Priority_Attribute; + ---------------------------- -- Is_Expression_Function -- ---------------------------- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 36cae43..93fadaa 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -1376,6 +1376,11 @@ package Sem_Util is function Is_Entry_Declaration (Id : Entity_Id) return Boolean; -- Determine whether entity Id is the spec entity of an entry [family] + function Is_Expanded_Priority_Attribute (E : Entity_Id) return Boolean; + -- Check whether a function in a call is an expanded priority attribute, + -- which is transformed into an Rtsfind call to Get_Ceiling. This expansion + -- does not take place in a configurable runtime. + function Is_Expression_Function (Subp : Entity_Id) return Boolean; -- Determine whether subprogram [body] Subp denotes an expression function |