Conctyp : Entity_Id;
Lo : Node_Id;
Hi : Node_Id) return Boolean;
+ -- Determine whether an entry family is potentially large because one of
+ -- its bounds denotes a discrminant.
function Is_Private_Primitive_Subprogram (Id : Entity_Id) return Boolean;
-- Determine whether Id is a function or a procedure and is marked as a
-- structure.
if Present (Index) then
- S := Etype (Discrete_Subtype_Definition (Declaration_Node (Ent)));
+ S := Entry_Index_Type (Ent);
Expr :=
Make_Op_Add (Sloc,
Set_Intval (Num, Intval (Num) + 1);
elsif Ekind (Prev) = E_Entry_Family then
- S :=
- Etype (Discrete_Subtype_Definition (Declaration_Node (Prev)));
+ S := Entry_Index_Type (Prev);
-- The need for the following full view retrieval stems from this
-- complex case of nested generics and tasking:
Next (Comp);
end loop;
- Typ := Etype (Discrete_Subtype_Definition (Parent (Ent)));
+ Typ := Entry_Index_Type (Ent);
Hi := Type_High_Bound (Typ);
Lo := Type_Low_Bound (Typ);
Large := Is_Potentially_Large_Family
Add_If_Clause (Make_Integer_Literal (Loc, 1));
elsif Ekind (Ent) = E_Entry_Family then
- E_Typ := Etype (Discrete_Subtype_Definition (Parent (Ent)));
+ E_Typ := Entry_Index_Type (Ent);
Hi := Convert_Discriminant_Ref (Type_High_Bound (E_Typ));
Lo := Convert_Discriminant_Ref (Type_Low_Bound (E_Typ));
Add_If_Clause (Family_Size (Loc, Hi, Lo, Typ, False));
Efam_Type := Make_Temporary (Loc, 'F');
declare
- Bas : Entity_Id :=
- Base_Type
- (Etype (Discrete_Subtype_Definition (Parent (Efam))));
-
- Bas_Decl : Node_Id := Empty;
- Lo, Hi : Node_Id;
+ Eityp : constant Entity_Id := Entry_Index_Type (Efam);
+ Lo : constant Node_Id := Type_Low_Bound (Eityp);
+ Hi : constant Node_Id := Type_High_Bound (Eityp);
+ Bdecl : Node_Id;
+ Bityp : Entity_Id;
begin
- Get_Index_Bounds
- (Discrete_Subtype_Definition (Parent (Efam)), Lo, Hi);
+ Bityp := Base_Type (Eityp);
- if Is_Potentially_Large_Family (Bas, Conctyp, Lo, Hi) then
- Bas := Make_Temporary (Loc, 'B');
+ if Is_Potentially_Large_Family (Bityp, Conctyp, Lo, Hi) then
+ Bityp := Make_Temporary (Loc, 'B');
- Bas_Decl :=
+ Bdecl :=
Make_Subtype_Declaration (Loc,
- Defining_Identifier => Bas,
+ Defining_Identifier => Bityp,
Subtype_Indication =>
Make_Subtype_Indication (Loc,
Subtype_Mark =>
Make_Integer_Literal
(Loc, Entry_Family_Bound - 1)))));
- Insert_After (Current_Node, Bas_Decl);
- Current_Node := Bas_Decl;
- Analyze (Bas_Decl);
+ Insert_After (Current_Node, Bdecl);
+ Current_Node := Bdecl;
+ Analyze (Bdecl);
end if;
Efam_Decl :=
Type_Definition =>
Make_Unconstrained_Array_Definition (Loc,
Subtype_Marks =>
- (New_List (New_Occurrence_Of (Bas, Loc))),
+ (New_List (New_Occurrence_Of (Bityp, Loc))),
Component_Definition =>
Make_Component_Definition (Loc,
Constraint =>
Make_Index_Or_Discriminant_Constraint (Loc,
Constraints => New_List (
- New_Occurrence_Of
- (Etype (Discrete_Subtype_Definition
- (Parent (Efam))), Loc)))))));
-
+ New_Occurrence_Of (Entry_Index_Type (Efam),
+ Loc)))))));
end if;
Next_Entity (Efam);
-- using the index subtype which may mention a discriminant.
if Present (Index) then
- S := Etype (Discrete_Subtype_Definition (Declaration_Node (Ent)));
+ S := Entry_Index_Type (Ent);
Expr :=
Make_Op_Add (Sloc,
Set_Intval (Num, Intval (Num) + 1);
elsif Ekind (Prev) = E_Entry_Family then
- S := Etype (Discrete_Subtype_Definition (Declaration_Node (Prev)));
+ S := Entry_Index_Type (Prev);
Lo := Type_Low_Bound (S);
Hi := Type_High_Bound (S);