aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch5.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/exp_ch5.adb')
-rw-r--r--gcc/ada/exp_ch5.adb38
1 files changed, 13 insertions, 25 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 382302c..2e14c97 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -2392,11 +2392,10 @@ package body Exp_Ch5 is
if Ada_Version >= Ada_2005 then
declare
- Call : Node_Id;
- Conctyp : Entity_Id;
- Ent : Entity_Id;
- Subprg : Entity_Id;
- RT_Subprg_Name : Node_Id;
+ Call : Node_Id;
+ Ent : Entity_Id;
+ Prottyp : Entity_Id;
+ RT_Subprg : RE_Id;
begin
-- Handle chains of renamings
@@ -2418,36 +2417,25 @@ package body Exp_Ch5 is
-- Look for the enclosing protected type
- Conctyp := Current_Scope;
- while not Is_Protected_Type (Conctyp) loop
- Conctyp := Scope (Conctyp);
+ Prottyp := Current_Scope;
+ while not Is_Protected_Type (Prottyp) loop
+ Prottyp := Scope (Prottyp);
end loop;
- pragma Assert (Is_Protected_Type (Conctyp));
-
- -- Generate the first actual of the call
-
- Subprg := Current_Scope;
- while
- not (Is_Subprogram_Or_Entry (Subprg)
- and then Present (Protected_Body_Subprogram (Subprg)))
- loop
- Subprg := Scope (Subprg);
- end loop;
+ pragma Assert (Is_Protected_Type (Prottyp));
-- Select the appropriate run-time call
- if Number_Entries (Conctyp) = 0 then
- RT_Subprg_Name :=
- New_Occurrence_Of (RTE (RE_Set_Ceiling), Loc);
+ if Has_Entries (Prottyp) then
+ RT_Subprg := RO_PE_Set_Ceiling;
else
- RT_Subprg_Name :=
- New_Occurrence_Of (RTE (RO_PE_Set_Ceiling), Loc);
+ RT_Subprg := RE_Set_Ceiling;
end if;
Call :=
Make_Procedure_Call_Statement (Loc,
- Name => RT_Subprg_Name,
+ Name =>
+ New_Occurrence_Of (RTE (RT_Subprg), Loc),
Parameter_Associations => New_List (
New_Copy_Tree (First (Parameter_Associations (Ent))),
Relocate_Node (Expression (N))));