-- 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
----------------------------------
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;
-- 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);
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;
Tdec : Node_Id;
Tdef : Node_Id;
Tnam : Name_Id;
- Ttyp : Node_Id;
+ Ttyp : Entity_Id;
begin
Ttyp := Corresponding_Concurrent_Type (Task_Rec);
-- 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