Commit b5c8da6b by Hristian Kirtchev Committed by Pierre-Marie de Rodat

[Ada] Minor reformatting

2019-07-03  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* bindgen.adb, inline.adb, layout.adb, sem_ch12.adb,
	sem_ch13.adb, sem_ch7.adb, styleg.adb: Minor reformatting.

From-SVN: r272973
parent c4487c3b
2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
* bindgen.adb, inline.adb, layout.adb, sem_ch12.adb,
sem_ch13.adb, sem_ch7.adb, styleg.adb: Minor reformatting.
2019-07-03 Bob Duff <duff@adacore.com> 2019-07-03 Bob Duff <duff@adacore.com>
* par-ch3.adb (P_Defining_Identifier): Call * par-ch3.adb (P_Defining_Identifier): Call
......
...@@ -1811,7 +1811,7 @@ package body Bindgen is ...@@ -1811,7 +1811,7 @@ package body Bindgen is
-- with a pragma Volatile in order to tell the compiler to preserve -- with a pragma Volatile in order to tell the compiler to preserve
-- this variable at any level of optimization. -- this variable at any level of optimization.
-- CodePeer and CCG do not need this extra code on the other hand. -- CodePeer and CCG do not need this extra code on the other hand
if Bind_Main_Program if Bind_Main_Program
and then not CodePeer_Mode and then not CodePeer_Mode
......
...@@ -2381,16 +2381,16 @@ package body Inline is ...@@ -2381,16 +2381,16 @@ package body Inline is
-- When generating C code, declare _Result, which may be used in the -- When generating C code, declare _Result, which may be used in the
-- inlined _Postconditions procedure to verify the return value. -- inlined _Postconditions procedure to verify the return value.
procedure Make_Loop_Labels_Unique (Stats : Node_Id);
-- When compiling for CCG and performing front-end inlining, replace
-- loop names and references to them so that they do not conflict
-- with homographs in the current subprogram.
procedure Make_Exit_Label; procedure Make_Exit_Label;
-- Build declaration for exit label to be used in Return statements, -- Build declaration for exit label to be used in Return statements,
-- sets Exit_Lab (the label node) and Lab_Decl (corresponding implicit -- sets Exit_Lab (the label node) and Lab_Decl (corresponding implicit
-- declaration). Does nothing if Exit_Lab already set. -- declaration). Does nothing if Exit_Lab already set.
procedure Make_Loop_Labels_Unique (HSS : Node_Id);
-- When compiling for CCG and performing front-end inlining, replace
-- loop names and references to them so that they do not conflict with
-- homographs in the current subprogram.
function Process_Formals (N : Node_Id) return Traverse_Result; function Process_Formals (N : Node_Id) return Traverse_Result;
-- Replace occurrence of a formal with the corresponding actual, or the -- Replace occurrence of a formal with the corresponding actual, or the
-- thunk generated for it. Replace a return statement with an assignment -- thunk generated for it. Replace a return statement with an assignment
...@@ -2483,9 +2483,7 @@ package body Inline is ...@@ -2483,9 +2483,7 @@ package body Inline is
-- Make_Loop_Labels_Unique -- -- Make_Loop_Labels_Unique --
----------------------------- -----------------------------
procedure Make_Loop_Labels_Unique (Stats : Node_Id) is procedure Make_Loop_Labels_Unique (HSS : Node_Id) is
S : Node_Id;
function Process_Loop (N : Node_Id) return Traverse_Result; function Process_Loop (N : Node_Id) return Traverse_Result;
------------------ ------------------
...@@ -2499,8 +2497,7 @@ package body Inline is ...@@ -2499,8 +2497,7 @@ package body Inline is
if Nkind (N) = N_Loop_Statement if Nkind (N) = N_Loop_Statement
and then Present (Identifier (N)) and then Present (Identifier (N))
then then
-- Create new external name for loop and update the
-- Create new external name for loop. and update the
-- corresponding entity. -- corresponding entity.
Id := Entity (Identifier (N)); Id := Entity (Identifier (N));
...@@ -2510,9 +2507,8 @@ package body Inline is ...@@ -2510,9 +2507,8 @@ package body Inline is
elsif Nkind (N) = N_Exit_Statement elsif Nkind (N) = N_Exit_Statement
and then Present (Name (N)) and then Present (Name (N))
then then
-- The exit statement must name an enclosing loop, whose name
-- The exit statement must name an enclosing loop, whose -- has already been updated.
-- name has already been updated.
Set_Chars (Name (N), Chars (Entity (Name (N)))); Set_Chars (Name (N), Chars (Entity (Name (N))));
end if; end if;
...@@ -2522,12 +2518,18 @@ package body Inline is ...@@ -2522,12 +2518,18 @@ package body Inline is
procedure Update_Loop_Names is new Traverse_Proc (Process_Loop); procedure Update_Loop_Names is new Traverse_Proc (Process_Loop);
-- Local variables
Stmt : Node_Id;
-- Start of processing for Make_Loop_Labels_Unique
begin begin
if Modify_Tree_For_C then if Modify_Tree_For_C then
S := First (Statements (Stats)); Stmt := First (Statements (HSS));
while Present (S) loop while Present (Stmt) loop
Update_Loop_Names (S); Update_Loop_Names (Stmt);
Next (S); Next (Stmt);
end loop; end loop;
end if; end if;
end Make_Loop_Labels_Unique; end Make_Loop_Labels_Unique;
......
...@@ -463,7 +463,7 @@ package body Layout is ...@@ -463,7 +463,7 @@ package body Layout is
and then Known_Static_Esize (CT) and then Known_Static_Esize (CT)
and then not (Known_Alignment (CT) and then not (Known_Alignment (CT)
and then Alignment_In_Bits (CT) > and then Alignment_In_Bits (CT) >
Standard_Long_Long_Integer_Size) Standard_Long_Long_Integer_Size)
then then
declare declare
S : constant Uint := Esize (CT); S : constant Uint := Esize (CT);
......
...@@ -6198,8 +6198,8 @@ package body Sem_Ch12 is ...@@ -6198,8 +6198,8 @@ package body Sem_Ch12 is
function Is_Defaulted (Param : Entity_Id) return Boolean; function Is_Defaulted (Param : Entity_Id) return Boolean;
-- If the formql package has partly box-initialized formals, skip -- If the formql package has partly box-initialized formals, skip
-- conformace check for these formals. Previously the code assumed -- conformace check for these formals. Previously the code assumed
-- that boc initialization for a formal package applied to all -- that boc initialization for a formal package applied to all its
-- its formal parameters. -- formal parameters.
function Same_Instantiated_Constant (E1, E2 : Entity_Id) return Boolean; function Same_Instantiated_Constant (E1, E2 : Entity_Id) return Boolean;
-- The formal may come from a nested formal package, and the actual may -- The formal may come from a nested formal package, and the actual may
...@@ -6257,9 +6257,11 @@ package body Sem_Ch12 is ...@@ -6257,9 +6257,11 @@ package body Sem_Ch12 is
function Is_Defaulted (Param : Entity_Id) return Boolean is function Is_Defaulted (Param : Entity_Id) return Boolean is
Assoc : Node_Id; Assoc : Node_Id;
begin begin
Assoc := First (Generic_Associations Assoc :=
(Parent (Associated_Formal_Package (Actual_Pack)))); First (Generic_Associations (Parent
(Associated_Formal_Package (Actual_Pack))));
while Present (Assoc) loop while Present (Assoc) loop
if Nkind (Assoc) = N_Others_Choice then if Nkind (Assoc) = N_Others_Choice then
......
...@@ -9328,8 +9328,8 @@ package body Sem_Ch13 is ...@@ -9328,8 +9328,8 @@ package body Sem_Ch13 is
Analyze (End_Decl_Expr); Analyze (End_Decl_Expr);
Set_Is_Frozen (Ent, True); Set_Is_Frozen (Ent, True);
-- If the end of declarations comes before any other freeze -- If the end of declarations comes before any other freeze point,
-- point, the Freeze_Expr is not analyzed: no check needed. -- the Freeze_Expr is not analyzed: no check needed.
if Analyzed (Freeze_Expr) and then not In_Instance then if Analyzed (Freeze_Expr) and then not In_Instance then
Check_Overloaded_Name; Check_Overloaded_Name;
...@@ -9340,13 +9340,10 @@ package body Sem_Ch13 is ...@@ -9340,13 +9340,10 @@ package body Sem_Ch13 is
-- All other cases -- All other cases
else else
-- In a generic context freeze nodes are not always generated, so
-- analyze the expression now.
-- In a generic context freeze nodes are not always generated, if not Analyzed (Freeze_Expr) and then Inside_A_Generic then
-- so analyze the expression now.
if not Analyzed (Freeze_Expr)
and then Inside_A_Generic
then
Preanalyze (Freeze_Expr); Preanalyze (Freeze_Expr);
end if; end if;
......
...@@ -401,7 +401,7 @@ package body Sem_Ch7 is ...@@ -401,7 +401,7 @@ package body Sem_Ch7 is
if not Generate_C_Code if not Generate_C_Code
and then (Is_Inlined (Decl_Id) and then (Is_Inlined (Decl_Id)
or else Has_Pragma_Inline (Decl_Id)) or else Has_Pragma_Inline (Decl_Id))
then then
Has_Referencer_Of_Non_Subprograms := True; Has_Referencer_Of_Non_Subprograms := True;
...@@ -423,7 +423,7 @@ package body Sem_Ch7 is ...@@ -423,7 +423,7 @@ package body Sem_Ch7 is
if not Generate_C_Code if not Generate_C_Code
and then (Is_Inlined (Decl_Id) and then (Is_Inlined (Decl_Id)
or else Has_Pragma_Inline (Decl_Id)) or else Has_Pragma_Inline (Decl_Id))
then then
Has_Referencer_Of_Non_Subprograms := True; Has_Referencer_Of_Non_Subprograms := True;
......
...@@ -618,14 +618,18 @@ package body Styleg is ...@@ -618,14 +618,18 @@ package body Styleg is
begin begin
if Style_Check_Mixed_Case_Decls then if Style_Check_Mixed_Case_Decls then
case Determine_Token_Casing is case Determine_Token_Casing is
when All_Upper_Case | All_Lower_Case => when All_Lower_Case
| All_Upper_Case
=>
Error_Msg_SC -- CODEFIX Error_Msg_SC -- CODEFIX
("(style) bad capitalization, mixed case required"); ("(style) bad capitalization, mixed case required");
-- The Unknown case is something like A_B_C, which is both all -- The Unknown case is something like A_B_C, which is both all
-- caps and mixed case. -- caps and mixed case.
when Mixed_Case | Unknown => when Mixed_Case
| Unknown
=>
null; -- OK null; -- OK
end case; end case;
end if; end if;
......
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