then
-- If this is a constrained access definition for a record
-- component, we leave the type as an unconstrained access,
- -- and mark the component so that its actual type is build
- -- at a point of use (e.g an assignment statement). THis is
- -- handled in sem_util, Build_Actual_Subtype_Of_Component.
+ -- and mark the component so that its actual type is built
+ -- at a point of use (e.g., an assignment statement). This
+ -- is handled in Sem_Util.Build_Actual_Subtype_Of_Component.
if Desig_Type = Current_Scope
and then No (Def_Id)
Set_Ekind (Desig_Subtype, E_Record_Subtype);
Def_Id := Entity (Subtype_Mark (S));
- -- We indicate that the component has a pet-object
- -- constraint for uniform treatment at a point of use,
- -- even though the constraint may be independent of
- -- discriminants of enclosing type.
+ -- We indicate that the component has a per-object constraint
+ -- for treatment at a point of use, even though the constraint
+ -- may be independent of discriminants of the enclosing type.
if Nkind (Related_Nod) = N_Component_Declaration then
Set_Has_Per_Object_Constraint
Constrain_Discriminated_Type
(Desig_Subtype, S, Related_Nod, For_Access => True);
return;
-
end if;
-- Enforce rule that the constraint is illegal if there is an
function Build_Access_Record_Constraint (C : List_Id) return List_Id;
-- If the record component is a constrained access to the current
-- record, the subtype has not been constructed during analysis of
- -- the enclosing record type (see Analyze_Access). In that case build
- -- a constrainted access subtype after replacing references to the
- -- enclosing discriminants by the corresponding discriminant values
+ -- the enclosing record type (see Analyze_Access). In that case, build
+ -- a constrained access subtype after replacing references to the
+ -- enclosing discriminants with the corresponding discriminant values
-- of the prefix.
function Build_Actual_Array_Constraint return List_Id;
-- If one or more of the bounds of the component depends on
-- discriminants, build actual constraint using the discriminants
- -- of the prefx, as above.
+ -- of the prefix, as above.
function Build_Actual_Record_Constraint return List_Id;
-- Similar to previous one, for discriminated components constrained
D_Val : Node_Id;
begin
- -- Retrieve the constraint from the compomnent declaration, because
+ -- Retrieve the constraint from the component declaration, because
-- the component subtype has not been constructed and the component
-- type is an unconstrained access.
Set_Expression (D_Val,
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (P),
- Selector_Name =>
+ Selector_Name =>
New_Occurrence_Of (Entity (Expression (D)), Loc)));
elsif Denotes_Discriminant (D) then
D_Val := Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (P),
- Selector_Name => New_Occurrence_Of (Entity (D), Loc));
+ Selector_Name => New_Occurrence_Of (Entity (D), Loc));
else
D_Val := New_Copy_Tree (D);
begin
-- The subtype does not need to be created for a selected component
- -- in a Spec_Expression,
+ -- in a Spec_Expression.
if In_Spec_Expression then
return Empty;
end if;
elsif Nkind (N) = N_Selected_Component then
- -- THe entity of the selected compomnent allows us to retrieve
+ -- The entity of the selected component allows us to retrieve
-- the original constraint from its component declaration.
Sel := Entity (Selector_Name (N));