-- Obj_Id denotes the entity of the _object formal parameter of the
-- invariant procedure. All created checks are added to list Checks.
- procedure Add_Inherited_Invariant
+ procedure Add_Inherited_Invariants
(Full_Typ : Entity_Id;
Priv_Typ : Entity_Id;
Obj_Id : Entity_Id;
-- is added to list Checks. Flag Inherited should be set when the pragma
-- is inherited from a parent or interface type.
- procedure Add_Own_Invariant
+ procedure Add_Own_Invariants
(T : Entity_Id;
Obj_Id : Entity_Id;
Checks : in out List_Id;
Dim_Checks => Checks);
end Add_Array_Component_Invariants;
- -----------------------------
- -- Add_Inherited_Invariant --
- -----------------------------
+ ------------------------------
+ -- Add_Inherited_Invariants --
+ ------------------------------
- procedure Add_Inherited_Invariant
+ procedure Add_Inherited_Invariants
(Full_Typ : Entity_Id;
Priv_Typ : Entity_Id;
Obj_Id : Entity_Id;
elsif Present (Full_Typ) and then Entity (Arg1) = Full_Typ then
Rep_Typ := Full_Typ;
- -- Otherwise the pragma applies to a parent type in which case
- -- it will be processed at a later stage by
- -- Add_Parent_Invariants or Add_Interface_Invariants.
+ -- Otherwise the pragma applies to a parent type and will be
+ -- processed at a later step by routine Add_Parent_Invariants
+ -- or Add_Interface_Invariants.
else
return;
Next_Rep_Item (Prag);
end loop;
- end Add_Inherited_Invariant;
+ end Add_Inherited_Invariants;
------------------------------
-- Add_Interface_Invariants --
Ifaces : Elist_Id;
begin
- -- Generate an invariant check for each inherited class-wide
- -- invariant coming from all interfaces implemented by type T. Obj_Id
- -- denotes the entity of the _object formal parameter of the
- -- invariant procedure. All created checks are added to list Checks.
+ -- Generate an invariant check for each class-wide invariant coming
+ -- from all interfaces implemented by type T.
if Is_Tagged_Type (T) then
Collect_Interfaces (T, Ifaces);
Iface_Elmt := First_Elmt (Ifaces);
while Present (Iface_Elmt) loop
- Add_Inherited_Invariant
+ Add_Inherited_Invariants
(Full_Typ => Node (Iface_Elmt),
Priv_Typ => Empty,
Obj_Id => Obj_Id,
Add_Record_Component_Invariants (Full_Typ, Obj_Id, Checks);
end if;
- Add_Inherited_Invariant
+ Add_Inherited_Invariants
(Full_Typ => Full_Typ,
Priv_Typ => Priv_Typ,
Obj_Id => Obj_Id,
end loop;
end Add_Parent_Invariants;
- -----------------------
- -- Add_Own_Invariant --
- -----------------------
+ ------------------------
+ -- Add_Own_Invariants --
+ ------------------------
- procedure Add_Own_Invariant
+ procedure Add_Own_Invariants
(T : Entity_Id;
Obj_Id : Entity_Id;
Checks : in out List_Id;
Ploc := Sloc (Prag);
-- Verify the pragma belongs to T, otherwise the pragma applies
- -- to a parent type in which case it will be processed at a
- -- later stage by Add_Parent_Invariants or
- -- Add_Interface_Invariants.
+ -- to a parent type in which case it will be processed later by
+ -- Add_Parent_Invariants or Add_Interface_Invariants.
if Entity (Arg1) /= T then
return;
Expr := New_Copy_Tree (Arg2);
- -- Substitute all references to type T with references to
- -- the _object formal parameter.
+ -- Substitute all references to type T with references to the
+ -- _object formal parameter.
Replace_Type_References
(Expr => Expr,
Next_Rep_Item (Prag);
end loop;
- end Add_Own_Invariant;
+ end Add_Own_Invariants;
-------------------------------------
-- Add_Record_Component_Invariants --
if Partial_Invariant then
pragma Assert (Present (Priv_Typ));
- Add_Own_Invariant
+ Add_Own_Invariants
(T => Priv_Typ,
Obj_Id => Obj_Id,
Checks => Stmts);
-- of the partial view. This also handles any invariants on array or
-- record components.
- Add_Own_Invariant
+ Add_Own_Invariants
(T => Priv_Typ,
Obj_Id => Obj_Id,
Checks => Stmts,
Priv_Item => Priv_Item);
- Add_Own_Invariant
+ Add_Own_Invariants
(T => Full_Typ,
Obj_Id => Obj_Id,
Checks => Stmts,