end if;
return
- Type_Conformant_Parameters (
- Parameter_Specifications (Iface_Op_Spec),
- Parameter_Specifications (Wrapper_Spec));
+ Type_Conformant_Parameters
+ (Parameter_Specifications (Iface_Op_Spec),
+ Parameter_Specifications (Wrapper_Spec));
end Overriding_Possible;
-----------------------
Append_To (New_Formals,
Make_Parameter_Specification (Loc,
- Defining_Identifier =>
+ Defining_Identifier =>
Make_Defining_Identifier (Loc,
- Chars => Chars
- (Defining_Identifier (Formal))),
- In_Present => In_Present (Formal),
- Out_Present => Out_Present (Formal),
- Null_Exclusion_Present => Null_Exclusion_Present (Formal),
- Parameter_Type => Param_Type));
+ Chars => Chars (Defining_Identifier (Formal))),
+ In_Present => In_Present (Formal),
+ Out_Present => Out_Present (Formal),
+ Null_Exclusion_Present => Null_Exclusion_Present (Formal),
+ Parameter_Type => Param_Type));
Next (Formal);
end loop;
else
pragma Assert (Is_Private_Primitive_Subprogram (Subp_Id));
+
Obj_Param :=
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uO),
- In_Present => In_Present (Parent (First_Entity (Subp_Id))),
- Out_Present => Ekind (Subp_Id) /= E_Function,
- Parameter_Type => New_Occurrence_Of (Obj_Typ, Loc));
+ In_Present =>
+ In_Present (Parent (First_Entity (Subp_Id))),
+ Out_Present => Ekind (Subp_Id) /= E_Function,
+ Parameter_Type => New_Occurrence_Of (Obj_Typ, Loc));
+
Prepend_To (New_Formals, Obj_Param);
end if;
Unprotected_Mode => 'N');
begin
- if Ekind (Defining_Unit_Name (Specification (N))) =
- E_Subprogram_Body
+ if Ekind (Defining_Unit_Name (Specification (N))) = E_Subprogram_Body
then
Decl := Unit_Declaration_Node (Corresponding_Spec (N));
else
if Nkind (Specification (Decl)) = N_Procedure_Specification then
New_Spec :=
Make_Procedure_Specification (Loc,
- Defining_Unit_Name => New_Id,
+ Defining_Unit_Name => New_Id,
Parameter_Specifications => New_Plist);
-- Create a new specification for the anonymous subprogram type
else
New_Spec :=
Make_Function_Specification (Loc,
- Defining_Unit_Name => New_Id,
+ Defining_Unit_Name => New_Id,
Parameter_Specifications => New_Plist,
- Result_Definition =>
+ Result_Definition =>
Copy_Result_Type (Result_Definition (Specification (Decl))));
Set_Return_Present (Defining_Unit_Name (New_Spec));
Present (Interfaces (Corresponding_Record_Type (Prot_Typ)))
then
declare
+ Found : Boolean := False;
Prim_Elmt : Elmt_Id;
Prim_Op : Node_Id;
- Found : Boolean := False;
begin
Prim_Elmt :=
First_Elmt
(Primitive_Operations
- (Corresponding_Record_Type (Prot_Typ)));
+ (Corresponding_Record_Type (Prot_Typ)));
while Present (Prim_Elmt) loop
Prim_Op := Node (Prim_Elmt);
if Is_Primitive_Wrapper (Prim_Op)
- and then (Wrapped_Entity (Prim_Op))
- = Defining_Entity (Specification (Comp))
+ and then Wrapped_Entity (Prim_Op) =
+ Defining_Entity (Specification (Comp))
then
Found := True;
exit;
Specification =>
Build_Protected_Sub_Specification
(Comp, Prot_Typ, Dispatching_Mode));
+
Insert_After (Current_Node, Sub);
Analyze (Sub);
Body_Arr :=
Make_Object_Declaration (Loc,
Defining_Identifier => Body_Id,
- Aliased_Present => True,
- Object_Definition =>
+ Aliased_Present => True,
+ Object_Definition =>
Make_Subtype_Indication (Loc,
Subtype_Mark =>
New_Occurrence_Of
(RTE (RE_Protected_Entry_Body_Array), Loc),
- Constraint =>
+ Constraint =>
Make_Index_Or_Discriminant_Constraint (Loc,
Constraints => New_List (
Make_Range (Loc,
Make_Integer_Literal (Loc, 1),
Make_Integer_Literal (Loc, E_Count))))),
- Expression => Entries_Aggr);
+ Expression => Entries_Aggr);
when System_Tasking_Protected_Objects_Single_Entry =>
Body_Arr :=
Aliased_Present => True,
Object_Definition =>
New_Occurrence_Of (RTE (RE_Entry_Body), Loc),
- Expression => Remove_Head (Expressions (Entries_Aggr)));
+ Expression =>
+ Remove_Head (Expressions (Entries_Aggr)));
when others =>
raise Program_Error;
(Prim_Params : List_Id;
Iface_Params : List_Id) return Boolean
is
- Iface_Id : Entity_Id;
- Iface_Param : Node_Id;
- Iface_Typ : Entity_Id;
- Prim_Id : Entity_Id;
- Prim_Param : Node_Id;
- Prim_Typ : Entity_Id;
-
function Is_Implemented
(Ifaces_List : Elist_Id;
Iface : Entity_Id) return Boolean;
return False;
end Is_Implemented;
+ -- Local variables
+
+ Iface_Id : Entity_Id;
+ Iface_Param : Node_Id;
+ Iface_Typ : Entity_Id;
+ Prim_Id : Entity_Id;
+ Prim_Param : Node_Id;
+ Prim_Typ : Entity_Id;
+
-- Start of processing for Matches_Prefixed_View_Profile
begin
Prim_Param := First (Prim_Params);
- -- The first parameter of the potentially overridden subprogram
- -- must be an interface implemented by Prim.
+ -- The first parameter of the potentially overridden subprogram must
+ -- be an interface implemented by Prim.
if not Is_Interface (Iface_Typ)
or else not Is_Implemented (Ifaces_List, Iface_Typ)
return False;
end if;
- -- The checks on the object parameters are done, move onto the
- -- rest of the parameters.
+ -- The checks on the object parameters are done, move onto the rest
+ -- of the parameters.
if not In_Scope then
Prim_Param := Next (Prim_Param);
and then Is_Concurrent_Type (Designated_Type (Prim_Typ))
then
Iface_Typ := Designated_Type (Iface_Typ);
- Prim_Typ := Designated_Type (Prim_Typ);
+ Prim_Typ := Designated_Type (Prim_Typ);
end if;
-- Case of multiple interface types inside a parameter profile
-- (Obj_Param : in out Iface; ...; Param : Iface)
- -- If the interface type is implemented, then the matching type
- -- in the primitive should be the implementing record type.
+ -- If the interface type is implemented, then the matching type in
+ -- the primitive should be the implementing record type.
if Ekind (Iface_Typ) = E_Record_Type
and then Is_Interface (Iface_Typ)
return;
end if;
- -- Search for the concurrent declaration since it contains the list
- -- of all implemented interfaces. In this case, the subprogram is
- -- declared within the scope of a protected or a task type.
+ -- Search for the concurrent declaration since it contains the list of
+ -- all implemented interfaces. In this case, the subprogram is declared
+ -- within the scope of a protected or a task type.
if Present (Scope (Def_Id))
and then Is_Concurrent_Type (Scope (Def_Id))
then
In_Scope := False;
- -- This case occurs when the concurrent type is declared within
- -- a generic unit. As a result the corresponding record has been
- -- built and used as the type of the first formal, we just have
- -- to retrieve the corresponding concurrent type.
+ -- This case occurs when the concurrent type is declared within a
+ -- generic unit. As a result the corresponding record has been built
+ -- and used as the type of the first formal, we just have to retrieve
+ -- the corresponding concurrent type.
elsif Is_Concurrent_Record_Type (Typ)
and then not Is_Class_Wide_Type (Typ)
Subp : Entity_Id := Empty;
begin
- -- Traverse the homonym chain, looking for a potentially
- -- overridden subprogram that belongs to an implemented
- -- interface.
+ -- Traverse the homonym chain, looking for a potentially overridden
+ -- subprogram that belongs to an implemented interface.
Hom := Current_Entity_In_Scope (Def_Id);
while Present (Hom) loop
then
null;
- -- Entries and procedures can override abstract or null
- -- interface procedures.
+ -- Entries and procedures can override abstract or null interface
+ -- procedures.
- elsif (Ekind (Def_Id) = E_Procedure
- or else Ekind (Def_Id) = E_Entry)
+ elsif Ekind_In (Def_Id, E_Entry, E_Procedure)
and then Ekind (Subp) = E_Procedure
and then Matches_Prefixed_View_Profile
(Parameter_Specifications (Parent (Def_Id)),
Candidate := Subp;
-- For an overridden subprogram Subp, check whether the mode
- -- of its first parameter is correct depending on the kind
- -- of synchronized type.
+ -- of its first parameter is correct depending on the kind of
+ -- synchronized type.
declare
Formal : constant Node_Id := First_Formal (Candidate);
begin
-- In order for an entry or a protected procedure to
- -- override, the first parameter of the overridden
- -- routine must be of mode "out", "in out" or
- -- access-to-variable.
+ -- override, the first parameter of the overridden routine
+ -- must be of mode "out", "in out" or access-to-variable.
if Ekind_In (Candidate, E_Entry, E_Procedure)
and then Is_Protected_Type (Typ)
then
null;
- -- All other cases are OK since a task entry or routine
- -- does not have a restriction on the mode of the first
- -- parameter of the overridden interface routine.
+ -- All other cases are OK since a task entry or routine does
+ -- not have a restriction on the mode of the first parameter
+ -- of the overridden interface routine.
else
Overridden_Subp := Candidate;
-- If an inherited subprogram is implemented by a protected
-- function, then the first parameter of the inherited
- -- subprogram shall be of mode in, but not an
- -- access-to-variable parameter (RM 9.4(11/9)
+ -- subprogram shall be of mode in, but not an access-to-
+ -- variable parameter (RM 9.4(11/9)
if Present (First_Formal (Subp))
and then Ekind (First_Formal (Subp)) = E_In_Parameter
-- Has_Matching_Entry_Or_Subprogram --
--------------------------------------
- function Has_Matching_Entry_Or_Subprogram (E : Entity_Id) return Boolean
+ function Has_Matching_Entry_Or_Subprogram
+ (E : Entity_Id) return Boolean
is
function Check_Conforming_Parameters
(E1_Param : Node_Id;
begin
while Present (Param_E1) and then Present (Param_E2) loop
- if Ekind (Defining_Identifier (Param_E1))
- /= Ekind (Defining_Identifier (Param_E2))
+ if Ekind (Defining_Identifier (Param_E1)) /=
+ Ekind (Defining_Identifier (Param_E2))
or else not
- Conforming_Types (Find_Parameter_Type (Param_E1),
- Find_Parameter_Type (Param_E2),
- Subtype_Conformant)
+ Conforming_Types
+ (Find_Parameter_Type (Param_E1),
+ Find_Parameter_Type (Param_E2),
+ Subtype_Conformant)
then
return False;
end if;
begin
-- Search for entities in the enclosing scope of this synchonized
- -- type
+ -- type.
pragma Assert (Is_Concurrent_Type (Conc_Typ));
Push_Scope (Scope (Conc_Typ));
begin
-- Temporarily decorate the first parameter of Subp as controlling
- -- formal; required to invoke Subtype_Conformant()
+ -- formal, required to invoke Subtype_Conformant.
Set_Is_Controlling_Formal (First_Entity (Subp));
end loop;
Set_Is_Controlling_Formal (First_Entity (Subp), ICF);
+
return Empty;
end Matching_Original_Protected_Subprogram;
and then Is_Concurrent_Record_Type (Etype (First_Entity (E)))
then
if Scope (E) =
- Scope (Corresponding_Concurrent_Type (
- Etype (First_Entity (E))))
+ Scope (Corresponding_Concurrent_Type
+ (Etype (First_Entity (E))))
and then
Present
(Matching_Entry_Or_Subprogram
and then
Present
(Matching_Original_Protected_Subprogram
- (Corresponding_Concurrent_Type (Etype (First_Entity (E))),
- Subp => E))
+ (Corresponding_Concurrent_Type (Etype (First_Entity (E))),
+ Subp => E))
then
Report_Conflict (E,
Matching_Original_Protected_Subprogram
----------------------------
function Is_Private_Declaration (E : Entity_Id) return Boolean is
- Priv_Decls : List_Id;
Decl : constant Node_Id := Unit_Declaration_Node (E);
+ Priv_Decls : List_Id;
begin
if Is_Package_Or_Generic_Package (Current_Scope)
is
AO : constant Entity_Id := Alias (Old_E);
AN : constant Entity_Id := Alias (New_E);
+
begin
return Scope (AO) /= Scope (AN)
or else No (DTC_Entity (AO))