* [COMMITTED] ada: Remove leftover code for counting protected entries
@ 2023-05-26 7:36 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-05-26 7:36 UTC (permalink / raw)
To: gcc-patches; +Cc: Piotr Trojanek
From: Piotr Trojanek <trojanek@adacore.com>
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.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/exp_ch9.adb | 25 +++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 68f1290cab4..b0e3632b8c8 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
--
2.40.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-26 7:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26 7:36 [COMMITTED] ada: Remove leftover code for counting protected entries Marc Poulhiès
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).