+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.
-- 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;
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;
-- 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
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 --
----------------------------
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