Commit 0c506265 by Hristian Kirtchev Committed by Pierre-Marie de Rodat

[Ada] Minor reformatting

2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* checks.adb, exp_ch5.adb, exp_ch7.adb, exp_unst.adb, sem_eval.adb:
	Minor reformatting.

From-SVN: r260941
parent 42e508b4
2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
* checks.adb, exp_ch5.adb, exp_ch7.adb, exp_unst.adb, sem_eval.adb:
Minor reformatting.
2018-05-30 Pascal Obry <obry@adacore.com> 2018-05-30 Pascal Obry <obry@adacore.com>
* libgnat/g-comlin.ads (Value_Callback, Define_Switch): New. * libgnat/g-comlin.ads (Value_Callback, Define_Switch): New.
......
...@@ -3065,6 +3065,7 @@ package body Checks is ...@@ -3065,6 +3065,7 @@ package body Checks is
-- If definitely not in range, warn -- If definitely not in range, warn
elsif Lov > Hi or else Hiv < Lo then elsif Lov > Hi or else Hiv < Lo then
-- Ignore out of range values for System.Priority in -- Ignore out of range values for System.Priority in
-- CodePeer mode since the actual target compiler may -- CodePeer mode since the actual target compiler may
-- provide a wider range. -- provide a wider range.
......
...@@ -3286,6 +3286,7 @@ package body Exp_Ch5 is ...@@ -3286,6 +3286,7 @@ package body Exp_Ch5 is
Parameter_Associations => New_List ( Parameter_Associations => New_List (
Convert_To_Iterable_Type (Container, Loc), Convert_To_Iterable_Type (Container, Loc),
New_Occurrence_Of (Cursor, Loc)))); New_Occurrence_Of (Cursor, Loc))));
Set_Statements (New_Loop, Set_Statements (New_Loop,
New_List New_List
(Make_Block_Statement (Loc, (Make_Block_Statement (Loc,
......
...@@ -3969,8 +3969,8 @@ package body Exp_Ch7 is ...@@ -3969,8 +3969,8 @@ package body Exp_Ch7 is
begin begin
-- For restricted run-time libraries (Ravenscar), tasks are -- For restricted run-time libraries (Ravenscar), tasks are
-- non-terminating and they can only appear at library level, so we do -- non-terminating and they can only appear at library level,
-- not want finalization of task objects. -- so we do not want finalization of task objects.
if Restricted_Profile then if Restricted_Profile then
return Empty; return Empty;
...@@ -4014,37 +4014,42 @@ package body Exp_Ch7 is ...@@ -4014,37 +4014,42 @@ package body Exp_Ch7 is
Make_Defining_Identifier (Loc, Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('I')); Chars => New_Internal_Name ('I'));
Elab_Body := Make_Subprogram_Body (Loc, Elab_Body :=
Specification => Make_Subprogram_Body (Loc,
Make_Procedure_Specification (Loc, Specification =>
Defining_Unit_Name => Elab_Proc), Make_Procedure_Specification (Loc,
Declarations => New_List, Defining_Unit_Name => Elab_Proc),
Handled_Statement_Sequence => Declarations => New_List,
Relocate_Node (Handled_Statement_Sequence (N))); Handled_Statement_Sequence =>
Relocate_Node (Handled_Statement_Sequence (N)));
Elab_Call :=
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Elab_Proc, Loc));
Elab_Call := Make_Procedure_Call_Statement (Loc,
New_Occurrence_Of (Elab_Proc, Loc));
Append_To (Declarations (N), Elab_Body); Append_To (Declarations (N), Elab_Body);
Analyze (Elab_Body); Analyze (Elab_Body);
Set_Has_Nested_Subprogram (Elab_Proc); Set_Has_Nested_Subprogram (Elab_Proc);
Set_Handled_Statement_Sequence (N, Set_Handled_Statement_Sequence (N,
Make_Handled_Sequence_Of_Statements (Loc, Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Elab_Call))); Statements => New_List (Elab_Call)));
Analyze (Elab_Call); Analyze (Elab_Call);
-- The scope of all blocks in the elaboration code is -- The scope of all blocks in the elaboration code is now the
-- now the constructed elaboration procedure. Nested -- constructed elaboration procedure. Nested subprograms within
-- subprograms within those blocks will have activation -- those blocks will have activation records if they contain
-- records if they contain references to entities in the -- references to entities in the enclosing block.
-- enclosing block.
Stat :=
First (Statements (Handled_Statement_Sequence (Elab_Body)));
Stat := First
(Statements (Handled_Statement_Sequence (Elab_Body)));
while Present (Stat) loop while Present (Stat) loop
if Nkind (Stat) = N_Block_Statement then if Nkind (Stat) = N_Block_Statement then
Set_Scope (Entity (Identifier (Stat)), Elab_Proc); Set_Scope (Entity (Identifier (Stat)), Elab_Proc);
end if; end if;
Next (Stat); Next (Stat);
end loop; end loop;
end if; end if;
......
...@@ -619,6 +619,7 @@ package body Exp_Unst is ...@@ -619,6 +619,7 @@ package body Exp_Unst is
procedure Register_Subprogram (E : Entity_Id; Bod : Node_Id) is procedure Register_Subprogram (E : Entity_Id; Bod : Node_Id) is
L : constant Nat := Get_Level (Subp, E); L : constant Nat := Get_Level (Subp, E);
begin begin
Subps.Append Subps.Append
((Ent => E, ((Ent => E,
...@@ -635,6 +636,7 @@ package body Exp_Unst is ...@@ -635,6 +636,7 @@ package body Exp_Unst is
ARECnPT => Empty, ARECnPT => Empty,
ARECnP => Empty, ARECnP => Empty,
ARECnU => Empty)); ARECnU => Empty));
Set_Subps_Index (E, UI_From_Int (Subps.Last)); Set_Subps_Index (E, UI_From_Int (Subps.Last));
end Register_Subprogram; end Register_Subprogram;
...@@ -645,10 +647,12 @@ package body Exp_Unst is ...@@ -645,10 +647,12 @@ package body Exp_Unst is
-- Record a subprogram call -- Record a subprogram call
when N_Procedure_Call_Statement | N_Function_Call => when N_Function_Call
| N_Procedure_Call_Statement
=>
-- We are only interested in direct calls, not indirect -- We are only interested in direct calls, not indirect
-- calls (where Name (N) is an explicit dereference). -- calls (where Name (N) is an explicit dereference) at
-- at least for now! -- least for now!
if Nkind (Name (N)) in N_Has_Entity then if Nkind (Name (N)) in N_Has_Entity then
Ent := Entity (Name (N)); Ent := Entity (Name (N));
...@@ -670,10 +674,10 @@ package body Exp_Unst is ...@@ -670,10 +674,10 @@ package body Exp_Unst is
-- for uplevel references. -- for uplevel references.
declare declare
Subp : Entity_Id;
Actual : Entity_Id; Actual : Entity_Id;
Formal : Node_Id;
DT : Boolean := False; DT : Boolean := False;
Formal : Node_Id;
Subp : Entity_Id;
begin begin
if Nkind (Name (N)) = N_Explicit_Dereference then if Nkind (Name (N)) = N_Explicit_Dereference then
...@@ -697,18 +701,18 @@ package body Exp_Unst is ...@@ -697,18 +701,18 @@ package body Exp_Unst is
end loop; end loop;
end; end;
-- An At_End_Proc in a statement sequence indicates that -- An At_End_Proc in a statement sequence indicates that there
-- there's a call from the enclosing construct or block -- is a call from the enclosing construct or block to that
-- to that subprogram. As above, the called entity must -- subprogram. As above, the called entity must be local and
-- be local and not imported. -- not imported.
when N_Handled_Sequence_Of_Statements => when N_Handled_Sequence_Of_Statements =>
if Present (At_End_Proc (N)) if Present (At_End_Proc (N))
and then Scope_Within (Entity (At_End_Proc (N)), Subp) and then Scope_Within (Entity (At_End_Proc (N)), Subp)
and then not Is_Imported (Entity (At_End_Proc (N))) and then not Is_Imported (Entity (At_End_Proc (N)))
then then
Append_Unique_Call ((N, Current_Subprogram, Append_Unique_Call
Entity (At_End_Proc (N)))); ((N, Current_Subprogram, Entity (At_End_Proc (N))));
end if; end if;
-- A 'Access reference is a (potential) call. -- A 'Access reference is a (potential) call.
...@@ -759,8 +763,8 @@ package body Exp_Unst is ...@@ -759,8 +763,8 @@ package body Exp_Unst is
declare declare
DT : Boolean := False; DT : Boolean := False;
begin begin
Check_Static_Type (Etype (Prefix (N)), Check_Static_Type
Empty, DT); (Etype (Prefix (N)), Empty, DT);
end; end;
return OK; return OK;
...@@ -818,6 +822,7 @@ package body Exp_Unst is ...@@ -818,6 +822,7 @@ package body Exp_Unst is
end if; end if;
-- Make new entry in subprogram table if not already made -- Make new entry in subprogram table if not already made
Register_Subprogram (Ent, N); Register_Subprogram (Ent, N);
-- We make a recursive call to scan the subprogram body, so -- We make a recursive call to scan the subprogram body, so
...@@ -852,8 +857,8 @@ package body Exp_Unst is ...@@ -852,8 +857,8 @@ package body Exp_Unst is
return Skip; return Skip;
-- If we have a body stub, visit the associated subunit, -- If we have a body stub, visit the associated subunit, which
-- which is a semantic descendant of the stub. -- is a semantic descendant of the stub.
when N_Body_Stub => when N_Body_Stub =>
Visit (Library_Unit (N)); Visit (Library_Unit (N));
...@@ -885,8 +890,8 @@ package body Exp_Unst is ...@@ -885,8 +890,8 @@ package body Exp_Unst is
-- Otherwise record an uplevel reference -- Otherwise record an uplevel reference
when others => when others =>
if if Nkind (N) in N_Has_Entity
Nkind (N) in N_Has_Entity and then Present (Entity (N)) and then Present (Entity (N))
then then
Ent := Entity (N); Ent := Entity (N);
...@@ -900,14 +905,14 @@ package body Exp_Unst is ...@@ -900,14 +905,14 @@ package body Exp_Unst is
and then and then
Chars (Enclosing_Subprogram (Ent)) /= Name_uParent Chars (Enclosing_Subprogram (Ent)) /= Name_uParent
-- Constants and variables are potentially -- Constants and variables are potentially uplevel
-- uplevel references to global declarations. -- references to global declarations.
and then and then
(Ekind_In (Ent, E_Constant, E_Variable) (Ekind_In (Ent, E_Constant, E_Variable)
-- Formals are interesting, but not if being used as mere -- Formals are interesting, but not if being used as
-- names of parameters for name notation calls. -- mere names of parameters for name notation calls.
or else or else
(Is_Formal (Ent) (Is_Formal (Ent)
...@@ -916,7 +921,7 @@ package body Exp_Unst is ...@@ -916,7 +921,7 @@ package body Exp_Unst is
and then Selector_Name (Parent (N)) = N)) and then Selector_Name (Parent (N)) = N))
-- Types other than known Is_Static types are -- Types other than known Is_Static types are
-- potentially interesting -- potentially interesting.
or else (Is_Type (Ent) or else (Is_Type (Ent)
and then not Is_Static_Type (Ent))) and then not Is_Static_Type (Ent)))
...@@ -2037,13 +2042,13 @@ package body Exp_Unst is ...@@ -2037,13 +2042,13 @@ package body Exp_Unst is
return; return;
end if; end if;
-- A specification will contain bodies if it contains instantiations -- A specification will contain bodies if it contains instantiations so
-- so examine package or subprogram declaration of the main unit, -- examine package or subprogram declaration of the main unit, when it
-- when it is present. -- is present.
if Nkind (Unit (N)) = N_Package_Body if Nkind (Unit (N)) = N_Package_Body
or else (Nkind (Unit (N)) = N_Subprogram_Body or else (Nkind (Unit (N)) = N_Subprogram_Body
and then not Acts_As_Spec (N)) and then not Acts_As_Spec (N))
then then
Do_Search (Library_Unit (N)); Do_Search (Library_Unit (N));
end if; end if;
......
...@@ -574,6 +574,7 @@ package body Sem_Eval is ...@@ -574,6 +574,7 @@ package body Sem_Eval is
null; null;
elsif Is_Out_Of_Range (N, T, Assume_Valid => True) then elsif Is_Out_Of_Range (N, T, Assume_Valid => True) then
-- Ignore out of range values for System.Priority in CodePeer -- Ignore out of range values for System.Priority in CodePeer
-- mode since the actual target compiler may provide a wider -- mode since the actual target compiler may provide a wider
-- range. -- range.
......
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