aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2023-03-23 20:15:19 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-26 09:29:18 +0200
commit4a555bfee36bf0ce7513c37e9d4fb1f23405a064 (patch)
tree0a2d405585248e467ff84be84cdd30a4e9bcb181 /gcc
parent70f609b01fde630141e683f9563545b8dff87ad6 (diff)
downloadgcc-4a555bfee36bf0ce7513c37e9d4fb1f23405a064.zip
gcc-4a555bfee36bf0ce7513c37e9d4fb1f23405a064.tar.gz
gcc-4a555bfee36bf0ce7513c37e9d4fb1f23405a064.tar.bz2
ada: Remove leftover code for counting protected entries
We used to count protected entries by iterating over component declarations, but then switched to iterating over entities and left some code that is no longer needed. Cleanup; semantics is unaffected (maybe except fixing an assertion failure in developer builds when there is pragma among entry family declarations). gcc/ada/ * exp_ch9.adb (Build_Entry_Count_Expression): Remove loop over component declaration; consequently remove a parameter that is no longer used; adapt callers. (Make_Task_Create_Call): Refine type of a local variable.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_ch9.adb25
1 files changed, 5 insertions, 20 deletions
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 68f1290..b0e3632 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -154,8 +154,7 @@ package body Exp_Ch9 is
-- N is the enclosing construct.
function Build_Entry_Count_Expression
- (Concurrent_Type : Node_Id;
- Component_List : List_Id;
+ (Concurrent_Type : Entity_Id;
Loc : Source_Ptr) return Node_Id;
-- Compute number of entries for concurrent object. This is a count of
-- simple entries, followed by an expression that computes the length
@@ -1428,14 +1427,12 @@ package body Exp_Ch9 is
----------------------------------
function Build_Entry_Count_Expression
- (Concurrent_Type : Node_Id;
- Component_List : List_Id;
+ (Concurrent_Type : Entity_Id;
Loc : Source_Ptr) return Node_Id
is
Eindx : Nat;
Ent : Entity_Id;
Ecount : Node_Id;
- Comp : Node_Id;
Lo : Node_Id;
Hi : Node_Id;
Typ : Entity_Id;
@@ -1459,13 +1456,8 @@ package body Exp_Ch9 is
-- Loop through entry families building the addition nodes
Ent := First_Entity (Concurrent_Type);
- Comp := First (Component_List);
while Present (Ent) loop
if Ekind (Ent) = E_Entry_Family then
- while Chars (Ent) /= Chars (Defining_Identifier (Comp)) loop
- Next (Comp);
- end loop;
-
Typ := Entry_Index_Type (Ent);
Hi := Type_High_Bound (Typ);
Lo := Type_Low_Bound (Typ);
@@ -9248,7 +9240,7 @@ package body Exp_Ch9 is
declare
Entry_Count_Expr : constant Node_Id :=
Build_Entry_Count_Expression
- (Prot_Typ, Cdecls, Loc);
+ (Prot_Typ, Loc);
Num_Attach_Handler : Nat := 0;
Protection_Subtype : Node_Id;
Ritem : Node_Id;
@@ -14232,7 +14224,7 @@ package body Exp_Ch9 is
Tdec : Node_Id;
Tdef : Node_Id;
Tnam : Name_Id;
- Ttyp : Node_Id;
+ Ttyp : Entity_Id;
begin
Ttyp := Corresponding_Concurrent_Type (Task_Rec);
@@ -14453,14 +14445,7 @@ package body Exp_Ch9 is
-- where a,b... are the entry family names for the task definition
- Ecount :=
- Build_Entry_Count_Expression
- (Ttyp,
- Component_Items
- (Component_List
- (Type_Definition
- (Parent (Corresponding_Record_Type (Ttyp))))),
- Loc);
+ Ecount := Build_Entry_Count_Expression (Ttyp, Loc);
Append_To (Args, Ecount);
-- Master parameter. This is a reference to the _Master parameter of