Commit ca90b962 by Gary Dismukes Committed by Arnaud Charlet

exp_ch9.adb, [...]: Minor reformatting and typo fixes.

2016-05-02  Gary Dismukes  <dismukes@adacore.com>

	* exp_ch9.adb, sem_ch6.adb, sem_ch6.ads: Minor reformatting and typo
	fixes.

From-SVN: r235741
parent bac5ba15
2016-05-02 Gary Dismukes <dismukes@adacore.com>
* exp_ch9.adb, sem_ch6.adb, sem_ch6.ads: Minor reformatting and typo
fixes.
2016-05-02 Hristian Kirtchev <kirtchev@adacore.com> 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb, exp_ch9.adb, einfo.adb, sem_ch4.adb, sem_ch6.adb: Minor * sem_ch3.adb, exp_ch9.adb, einfo.adb, sem_ch4.adb, sem_ch6.adb: Minor
......
...@@ -2641,7 +2641,7 @@ package body Exp_Ch9 is ...@@ -2641,7 +2641,7 @@ package body Exp_Ch9 is
pragma Assert (Is_Tagged_Type (Obj_Typ)); pragma Assert (Is_Tagged_Type (Obj_Typ));
-- Check if this subprogram has a profile that matches some interface -- Check if this subprogram has a profile that matches some interface
-- primitive -- primitive.
Check_Synchronized_Overriding (Subp_Id, Overridden_Subp); Check_Synchronized_Overriding (Subp_Id, Overridden_Subp);
...@@ -2694,8 +2694,8 @@ package body Exp_Ch9 is ...@@ -2694,8 +2694,8 @@ package body Exp_Ch9 is
end if; end if;
-- Do not generate the wrapper if no interface primitive is covered by -- Do not generate the wrapper if no interface primitive is covered by
-- the subprogram and it is not a primitive declared declared between -- the subprogram and it is not a primitive declared between two views
-- two views (see Process_Full_View). -- (see Process_Full_View).
if No (First_Param) if No (First_Param)
and then not Is_Private_Primitive_Subprogram (Subp_Id) and then not Is_Private_Primitive_Subprogram (Subp_Id)
...@@ -4214,7 +4214,7 @@ package body Exp_Ch9 is ...@@ -4214,7 +4214,7 @@ package body Exp_Ch9 is
Make_Defining_Identifier (Loc, Make_Defining_Identifier (Loc,
Chars => Build_Selected_Name (Prot_Typ, Def_Id, Append_Chr (Mode))); 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 -- of the object.operation notation may need its original name (see
-- Sem_Ch4.Names_Match). -- Sem_Ch4.Names_Match).
...@@ -9648,7 +9648,7 @@ package body Exp_Ch9 is ...@@ -9648,7 +9648,7 @@ package body Exp_Ch9 is
-- Generate an overriding primitive operation specification for -- Generate an overriding primitive operation specification for
-- this subprogram if the protected type implements an interface -- 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 if Ada_Version >= Ada_2005
and then and then
...@@ -9800,7 +9800,7 @@ package body Exp_Ch9 is ...@@ -9800,7 +9800,7 @@ package body Exp_Ch9 is
-- Expand_N_Requeue_Statement -- -- 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 -- operations, depending on the source and destination (task or protected
-- object). A dispatching requeue statement is expanded into a call to the -- object). A dispatching requeue statement is expanded into a call to the
-- predefined primitive _Disp_Requeue. In addition, code is generated to -- predefined primitive _Disp_Requeue. In addition, code is generated to
...@@ -10004,7 +10004,7 @@ package body Exp_Ch9 is ...@@ -10004,7 +10004,7 @@ package body Exp_Ch9 is
-- and perform the appropriate kind of dispatching select. -- and perform the appropriate kind of dispatching select.
function Build_Normal_Requeue return Node_Id; 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 -- protected entry. Build the appropriate runtime call to perform the
-- action. -- action.
...@@ -10556,7 +10556,7 @@ package body Exp_Ch9 is ...@@ -10556,7 +10556,7 @@ package body Exp_Ch9 is
end if; end if;
end; end;
-- Processing for regular (non-dispatching) requeues -- Processing for regular (nondispatching) requeues
else else
Rewrite (N, Build_Normal_Requeue); Rewrite (N, Build_Normal_Requeue);
...@@ -12826,7 +12826,7 @@ package body Exp_Ch9 is ...@@ -12826,7 +12826,7 @@ package body Exp_Ch9 is
Else_Statements => D_Stats)); Else_Statements => D_Stats));
else 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. -- temporaries created for in-out parameters.
-- This makes unwarranted assumptions about the shape of the expanded -- This makes unwarranted assumptions about the shape of the expanded
......
...@@ -3246,9 +3246,9 @@ package body Sem_Ch6 is ...@@ -3246,9 +3246,9 @@ package body Sem_Ch6 is
-- modular analysis of the subprogram instead of a contextual -- modular analysis of the subprogram instead of a contextual
-- analysis at each call site. The same test is performed in -- analysis at each call site. The same test is performed in
-- Inline.Can_Be_Inlined_In_GNATprove_Mode. It is repeated -- Inline.Can_Be_Inlined_In_GNATprove_Mode. It is repeated
-- here in another form (because the contract has not -- here in another form (because the contract has not been
-- been attached to the body) to avoid frontend errors in -- attached to the body) to avoid front-end errors in case
-- case pragmas are used instead of aspects, because the -- pragmas are used instead of aspects, because the
-- corresponding pragmas in the body would not be transferred -- corresponding pragmas in the body would not be transferred
-- to the spec, leading to legality errors. -- to the spec, leading to legality errors.
...@@ -3743,7 +3743,7 @@ package body Sem_Ch6 is ...@@ -3743,7 +3743,7 @@ package body Sem_Ch6 is
return; return;
end if; end if;
-- Handle frontend inlining -- Handle front-end inlining
-- Note: Normally we don't do any inlining if expansion is off, since -- 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 -- we won't generate code in any case. An exception arises in GNATprove
...@@ -3756,7 +3756,7 @@ package body Sem_Ch6 is ...@@ -3756,7 +3756,7 @@ package body Sem_Ch6 is
and then Present (Spec_Id) and then Present (Spec_Id)
and then Has_Pragma_Inline (Spec_Id) and then Has_Pragma_Inline (Spec_Id)
then then
-- Legacy implementation (relying on frontend inlining) -- Legacy implementation (relying on front-end inlining)
if not Back_End_Inlining then if not Back_End_Inlining then
if (Has_Pragma_Inline_Always (Spec_Id) if (Has_Pragma_Inline_Always (Spec_Id)
...@@ -3829,7 +3829,7 @@ package body Sem_Ch6 is ...@@ -3829,7 +3829,7 @@ package body Sem_Ch6 is
-- In GNATprove mode, inline only when there is a separate subprogram -- In GNATprove mode, inline only when there is a separate subprogram
-- declaration for now, as inlining of subprogram bodies acting as -- 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 -- inlining. This inlining should occur after analysis of the body, so
-- that it is known whether the value of SPARK_Mode, which can be -- 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. -- defined by a pragma inside the body, is applicable to the body.
...@@ -4074,7 +4074,7 @@ package body Sem_Ch6 is ...@@ -4074,7 +4074,7 @@ package body Sem_Ch6 is
begin begin
-- Skip initial labels (for one thing this occurs when we are in -- 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. -- initial Push_xxx_Error_Label nodes, which are also irrelevant.
Stm := First (Statements (HSS)); Stm := First (Statements (HSS));
...@@ -6550,8 +6550,8 @@ package body Sem_Ch6 is ...@@ -6550,8 +6550,8 @@ package body Sem_Ch6 is
return False; return False;
end if; end if;
-- The checks on the object parameters are done, move onto the rest -- The checks on the object parameters are done, so move on to the
-- of the parameters. -- rest of the parameters.
if not In_Scope then if not In_Scope then
Prim_Param := Next (Prim_Param); Prim_Param := Next (Prim_Param);
...@@ -6616,7 +6616,7 @@ package body Sem_Ch6 is ...@@ -6616,7 +6616,7 @@ package body Sem_Ch6 is
Overridden_Subp := Empty; Overridden_Subp := Empty;
-- Def_Id must be an entry or a subprogram. We should skip predefined -- 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 -- stage predefined primitives are still not fully decorated. As a
-- minor optimization we skip here internally generated subprograms. -- minor optimization we skip here internally generated subprograms.
...@@ -6677,8 +6677,8 @@ package body Sem_Ch6 is ...@@ -6677,8 +6677,8 @@ package body Sem_Ch6 is
end if; end if;
end if; end if;
-- There is no overriding to check if is an inherited operation in a -- There is no overriding to check if this is an inherited operation in
-- type derivation on for a generic actual. -- a type derivation for a generic actual.
Collect_Interfaces (Typ, Ifaces_List); Collect_Interfaces (Typ, Ifaces_List);
...@@ -6732,7 +6732,7 @@ package body Sem_Ch6 is ...@@ -6732,7 +6732,7 @@ package body Sem_Ch6 is
begin begin
-- In order for an entry or a protected procedure to -- In order for an entry or a protected procedure to
-- override, the first parameter of the overridden routine -- 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) if Ekind_In (Candidate, E_Entry, E_Procedure)
and then Is_Protected_Type (Typ) and then Is_Protected_Type (Typ)
...@@ -6760,15 +6760,14 @@ package body Sem_Ch6 is ...@@ -6760,15 +6760,14 @@ package body Sem_Ch6 is
and then Matches_Prefixed_View_Profile and then Matches_Prefixed_View_Profile
(Parameter_Specifications (Parent (Def_Id)), (Parameter_Specifications (Parent (Def_Id)),
Parameter_Specifications (Parent (Subp))) Parameter_Specifications (Parent (Subp)))
and then Etype (Result_Definition (Parent (Def_Id))) = and then Etype (Def_Id) = Etype (Subp)
Etype (Result_Definition (Parent (Subp)))
then then
Candidate := Subp; Candidate := Subp;
-- If an inherited subprogram is implemented by a protected -- If an inherited subprogram is implemented by a protected
-- function, then the first parameter of the inherited -- function, then the first parameter of the inherited
-- subprogram shall be of mode in, but not an access-to- -- 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)) if Present (First_Formal (Subp))
and then Ekind (First_Formal (Subp)) = E_In_Parameter and then Ekind (First_Formal (Subp)) = E_In_Parameter
...@@ -6786,7 +6785,7 @@ package body Sem_Ch6 is ...@@ -6786,7 +6785,7 @@ package body Sem_Ch6 is
end loop; end loop;
-- After examining all candidates for overriding, we are left with -- 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 if In_Scope and then Present (Candidate) then
Error_Msg_PT (Def_Id, Candidate); Error_Msg_PT (Def_Id, Candidate);
...@@ -9360,7 +9359,7 @@ package body Sem_Ch6 is ...@@ -9360,7 +9359,7 @@ package body Sem_Ch6 is
-- instances that contain accidental overloadings. -- instances that contain accidental overloadings.
procedure Report_Conflict (S : Entity_Id; E : Entity_Id); 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 -- -- Check_For_Primitive_Subprogram --
...@@ -9698,8 +9697,8 @@ package body Sem_Ch6 is ...@@ -9698,8 +9697,8 @@ package body Sem_Ch6 is
(E1_Param : Node_Id; (E1_Param : Node_Id;
E2_Param : Node_Id) return Boolean; E2_Param : Node_Id) return Boolean;
-- Starting from the given parameters, check that all the parameters -- Starting from the given parameters, check that all the parameters
-- of two entries or subprograms are are subtype conformant. Used to -- of two entries or subprograms are subtype conformant. Used to skip
-- skip the check on the controlling argument. -- the check on the controlling argument.
function Matching_Entry_Or_Subprogram function Matching_Entry_Or_Subprogram
(Conc_Typ : Entity_Id; (Conc_Typ : Entity_Id;
...@@ -9712,7 +9711,7 @@ package body Sem_Ch6 is ...@@ -9712,7 +9711,7 @@ package body Sem_Ch6 is
(Conc_Typ : Entity_Id; (Conc_Typ : Entity_Id;
Ent : Entity_Id) return Entity_Id; Ent : Entity_Id) return Entity_Id;
-- Return the first dispatching primitive of Conc_Type defined in the -- 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 -- this concurrent type) whose name matches the entry Ent and has a
-- profile conformant with the profile of the corresponding (not yet -- profile conformant with the profile of the corresponding (not yet
-- built) dispatching primitive of Ent; return Empty if not found. -- built) dispatching primitive of Ent; return Empty if not found.
...@@ -9905,7 +9904,7 @@ package body Sem_Ch6 is ...@@ -9905,7 +9904,7 @@ package body Sem_Ch6 is
-- its profile is conformant with the profile of E. We check the -- its profile is conformant with the profile of E. We check the
-- name of the original protected subprogram associated with E since -- name of the original protected subprogram associated with E since
-- the expander builds dispatching primitives of protected functions -- 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) elsif not Comes_From_Source (E)
and then Is_Subprogram (E) and then Is_Subprogram (E)
...@@ -9924,9 +9923,9 @@ package body Sem_Ch6 is ...@@ -9924,9 +9923,9 @@ package body Sem_Ch6 is
Subp => E)); Subp => E));
return True; 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 -- procedure has been previously defined in the enclosing scope
-- of the synchronzed type. -- of the synchronized type.
elsif Comes_From_Source (E) elsif Comes_From_Source (E)
and then Ekind (E) = E_Entry and then Ekind (E) = E_Entry
...@@ -10063,8 +10062,8 @@ package body Sem_Ch6 is ...@@ -10063,8 +10062,8 @@ package body Sem_Ch6 is
return; return;
end if; end if;
-- For synchronized types check conflicts of this entity with -- For synchronized types check conflicts of this entity with previously
-- previously defined entities. -- defined entities.
if Ada_Version >= Ada_2005 if Ada_Version >= Ada_2005
and then Has_Matching_Entry_Or_Subprogram (S) and then Has_Matching_Entry_Or_Subprogram (S)
...@@ -11181,7 +11180,7 @@ package body Sem_Ch6 is ...@@ -11181,7 +11180,7 @@ package body Sem_Ch6 is
-- Discriminants" in Einfo. -- Discriminants" in Einfo.
-- We also exclude the case of Discrim_SO_Functions (functions used -- 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 -- functions only discriminants are referenced, and not only are such
-- subtypes not needed, but they cannot always be generated, because -- subtypes not needed, but they cannot always be generated, because
-- of order of elaboration issues. -- of order of elaboration issues.
......
...@@ -125,10 +125,10 @@ package Sem_Ch6 is ...@@ -125,10 +125,10 @@ package Sem_Ch6 is
procedure Check_Synchronized_Overriding procedure Check_Synchronized_Overriding
(Def_Id : Entity_Id; (Def_Id : Entity_Id;
Overridden_Subp : out Entity_Id); Overridden_Subp : out Entity_Id);
-- First determine if Def_Id is an entry or a subprogram either defined -- First determine if Def_Id is an entry or a subprogram either defined in
-- in the scope of a task or protected type, or is a primitive of such -- the scope of a task or protected type, or that is a primitive of such
-- a type. Check whether Def_Id overrides a subprogram of an interface -- a type. Check whether Def_Id overrides a subprogram of an interface
-- implemented by the synchronized type, return the overridden entity -- implemented by the synchronized type, returning the overridden entity
-- or Empty. -- or Empty.
procedure Check_Type_Conformant procedure Check_Type_Conformant
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment