pragma Assert (Is_Tagged_Type (Obj_Typ));
-- Check if this subprogram has a profile that matches some interface
- -- primitive
+ -- primitive.
Check_Synchronized_Overriding (Subp_Id, Overridden_Subp);
end if;
-- Do not generate the wrapper if no interface primitive is covered by
- -- the subprogram and it is not a primitive declared declared between
- -- two views (see Process_Full_View).
+ -- the subprogram and it is not a primitive declared between two views
+ -- (see Process_Full_View).
if No (First_Param)
and then not Is_Private_Primitive_Subprogram (Subp_Id)
Make_Defining_Identifier (Loc,
Chars => Build_Selected_Name (Prot_Typ, Def_Id, Append_Chr (Mode)));
- -- Reference the original non-dispatching subprogram since the analysis
+ -- Reference the original nondispatching subprogram since the analysis
-- of the object.operation notation may need its original name (see
-- Sem_Ch4.Names_Match).
-- Generate an overriding primitive operation specification for
-- this subprogram if the protected type implements an interface
- -- and Build_Wrapper_Spec did not not generate its wrapper.
+ -- and Build_Wrapper_Spec did not generate its wrapper.
if Ada_Version >= Ada_2005
and then
-- Expand_N_Requeue_Statement --
--------------------------------
- -- A non-dispatching requeue statement is expanded into one of four GNARLI
+ -- A nondispatching requeue statement is expanded into one of four GNARLI
-- operations, depending on the source and destination (task or protected
-- object). A dispatching requeue statement is expanded into a call to the
-- predefined primitive _Disp_Requeue. In addition, code is generated to
-- and perform the appropriate kind of dispatching select.
function Build_Normal_Requeue return Node_Id;
- -- N denotes a non-dispatching requeue statement to either a task or a
+ -- N denotes a nondispatching requeue statement to either a task or a
-- protected entry. Build the appropriate runtime call to perform the
-- action.
end if;
end;
- -- Processing for regular (non-dispatching) requeues
+ -- Processing for regular (nondispatching) requeues
else
Rewrite (N, Build_Normal_Requeue);
Else_Statements => D_Stats));
else
- -- Simple case of a non-dispatching trigger. Skip assignments to
+ -- Simple case of a nondispatching trigger. Skip assignments to
-- temporaries created for in-out parameters.
-- This makes unwarranted assumptions about the shape of the expanded
-- modular analysis of the subprogram instead of a contextual
-- analysis at each call site. The same test is performed in
-- Inline.Can_Be_Inlined_In_GNATprove_Mode. It is repeated
- -- here in another form (because the contract has not
- -- been attached to the body) to avoid frontend errors in
- -- case pragmas are used instead of aspects, because the
+ -- here in another form (because the contract has not been
+ -- attached to the body) to avoid front-end errors in case
+ -- pragmas are used instead of aspects, because the
-- corresponding pragmas in the body would not be transferred
-- to the spec, leading to legality errors.
return;
end if;
- -- Handle frontend inlining
+ -- Handle front-end inlining
-- Note: Normally we don't do any inlining if expansion is off, since
-- we won't generate code in any case. An exception arises in GNATprove
and then Present (Spec_Id)
and then Has_Pragma_Inline (Spec_Id)
then
- -- Legacy implementation (relying on frontend inlining)
+ -- Legacy implementation (relying on front-end inlining)
if not Back_End_Inlining then
if (Has_Pragma_Inline_Always (Spec_Id)
-- In GNATprove mode, inline only when there is a separate subprogram
-- declaration for now, as inlining of subprogram bodies acting as
- -- declarations, or subprogram stubs, are not supported by frontend
+ -- declarations, or subprogram stubs, are not supported by front-end
-- inlining. This inlining should occur after analysis of the body, so
-- that it is known whether the value of SPARK_Mode, which can be
-- defined by a pragma inside the body, is applicable to the body.
begin
-- Skip initial labels (for one thing this occurs when we are in
- -- front end ZCX mode, but in any case it is irrelevant), and also
+ -- front-end ZCX mode, but in any case it is irrelevant), and also
-- initial Push_xxx_Error_Label nodes, which are also irrelevant.
Stm := First (Statements (HSS));
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, so move on to the
+ -- rest of the parameters.
if not In_Scope then
Prim_Param := Next (Prim_Param);
Overridden_Subp := Empty;
-- Def_Id must be an entry or a subprogram. We should skip predefined
- -- primitives internally generated by the frontend; however at this
+ -- primitives internally generated by the front end; however at this
-- stage predefined primitives are still not fully decorated. As a
-- minor optimization we skip here internally generated subprograms.
end if;
end if;
- -- There is no overriding to check if is an inherited operation in a
- -- type derivation on for a generic actual.
+ -- There is no overriding to check if this is an inherited operation in
+ -- a type derivation for a generic actual.
Collect_Interfaces (Typ, Ifaces_List);
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.
+ -- 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)
and then Matches_Prefixed_View_Profile
(Parameter_Specifications (Parent (Def_Id)),
Parameter_Specifications (Parent (Subp)))
- and then Etype (Result_Definition (Parent (Def_Id))) =
- Etype (Result_Definition (Parent (Subp)))
+ and then Etype (Def_Id) = Etype (Subp)
then
Candidate := Subp;
-- 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)
+ -- variable parameter (RM 9.4(11/9)).
if Present (First_Formal (Subp))
and then Ekind (First_Formal (Subp)) = E_In_Parameter
end loop;
-- After examining all candidates for overriding, we are left with
- -- the best match which is a mode incompatible interface routine.
+ -- the best match, which is a mode-incompatible interface routine.
if In_Scope and then Present (Candidate) then
Error_Msg_PT (Def_Id, Candidate);
-- instances that contain accidental overloadings.
procedure Report_Conflict (S : Entity_Id; E : Entity_Id);
- -- Report conflict between entities S and E.
+ -- Report conflict between entities S and E
------------------------------------
-- Check_For_Primitive_Subprogram --
(E1_Param : Node_Id;
E2_Param : Node_Id) return Boolean;
-- Starting from the given parameters, check that all the parameters
- -- of two entries or subprograms are are subtype conformant. Used to
- -- skip the check on the controlling argument.
+ -- of two entries or subprograms are subtype conformant. Used to skip
+ -- the check on the controlling argument.
function Matching_Entry_Or_Subprogram
(Conc_Typ : Entity_Id;
(Conc_Typ : Entity_Id;
Ent : Entity_Id) return Entity_Id;
-- Return the first dispatching primitive of Conc_Type defined in the
- -- enclosing scope of Conc_Type (ie. before the full definition of
+ -- enclosing scope of Conc_Type (i.e. before the full definition of
-- this concurrent type) whose name matches the entry Ent and has a
-- profile conformant with the profile of the corresponding (not yet
-- built) dispatching primitive of Ent; return Empty if not found.
-- its profile is conformant with the profile of E. We check the
-- name of the original protected subprogram associated with E since
-- the expander builds dispatching primitives of protected functions
- -- and procedures with other name (see Exp_Ch9.Build_Selected_Name).
+ -- and procedures with other names (see Exp_Ch9.Build_Selected_Name).
elsif not Comes_From_Source (E)
and then Is_Subprogram (E)
Subp => E));
return True;
- -- Case : E is an entry of a synchronized type and a matching
+ -- Case 3: E is an entry of a synchronized type and a matching
-- procedure has been previously defined in the enclosing scope
- -- of the synchronzed type.
+ -- of the synchronized type.
elsif Comes_From_Source (E)
and then Ekind (E) = E_Entry
return;
end if;
- -- For synchronized types check conflicts of this entity with
- -- previously defined entities.
+ -- For synchronized types check conflicts of this entity with previously
+ -- defined entities.
if Ada_Version >= Ada_2005
and then Has_Matching_Entry_Or_Subprogram (S)
-- Discriminants" in Einfo.
-- We also exclude the case of Discrim_SO_Functions (functions used
- -- in front end layout mode for size/offset values), since in such
+ -- in front-end layout mode for size/offset values), since in such
-- functions only discriminants are referenced, and not only are such
-- subtypes not needed, but they cannot always be generated, because
-- of order of elaboration issues.