From b5c8da6bac845e685236eeedc02f0814c05ed42f Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Wed, 3 Jul 2019 08:14:43 +0000 Subject: [PATCH] [Ada] Minor reformatting 2019-07-03 Hristian Kirtchev gcc/ada/ * bindgen.adb, inline.adb, layout.adb, sem_ch12.adb, sem_ch13.adb, sem_ch7.adb, styleg.adb: Minor reformatting. From-SVN: r272973 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/bindgen.adb | 2 +- gcc/ada/inline.adb | 36 +++++++++++++++++++----------------- gcc/ada/layout.adb | 2 +- gcc/ada/sem_ch12.adb | 10 ++++++---- gcc/ada/sem_ch13.adb | 13 +++++-------- gcc/ada/sem_ch7.adb | 4 ++-- gcc/ada/styleg.adb | 8 ++++++-- 8 files changed, 45 insertions(+), 35 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 750100e9062..7879ba2215c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-07-03 Hristian Kirtchev + + * bindgen.adb, inline.adb, layout.adb, sem_ch12.adb, + sem_ch13.adb, sem_ch7.adb, styleg.adb: Minor reformatting. + 2019-07-03 Bob Duff * par-ch3.adb (P_Defining_Identifier): Call diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index 9efc873c3e4..5cc3ea2d9af 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -1811,7 +1811,7 @@ package body Bindgen is -- with a pragma Volatile in order to tell the compiler to preserve -- 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 and then not CodePeer_Mode diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index ae1c217c7fb..8672105f1e9 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -2381,16 +2381,16 @@ package body Inline is -- When generating C code, declare _Result, which may be used in the -- 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; -- Build declaration for exit label to be used in Return statements, -- sets Exit_Lab (the label node) and Lab_Decl (corresponding implicit -- 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; -- Replace occurrence of a formal with the corresponding actual, or the -- thunk generated for it. Replace a return statement with an assignment @@ -2483,9 +2483,7 @@ package body Inline is -- Make_Loop_Labels_Unique -- ----------------------------- - procedure Make_Loop_Labels_Unique (Stats : Node_Id) is - S : Node_Id; - + procedure Make_Loop_Labels_Unique (HSS : Node_Id) is function Process_Loop (N : Node_Id) return Traverse_Result; ------------------ @@ -2499,8 +2497,7 @@ package body Inline is if Nkind (N) = N_Loop_Statement and then Present (Identifier (N)) then - - -- Create new external name for loop. and update the + -- Create new external name for loop and update the -- corresponding entity. Id := Entity (Identifier (N)); @@ -2510,9 +2507,8 @@ package body Inline is elsif Nkind (N) = N_Exit_Statement and then Present (Name (N)) then - - -- The exit statement must name an enclosing loop, whose - -- name has already been updated. + -- The exit statement must name an enclosing loop, whose name + -- has already been updated. Set_Chars (Name (N), Chars (Entity (Name (N)))); end if; @@ -2522,12 +2518,18 @@ package body Inline is procedure Update_Loop_Names is new Traverse_Proc (Process_Loop); + -- Local variables + + Stmt : Node_Id; + + -- Start of processing for Make_Loop_Labels_Unique + begin if Modify_Tree_For_C then - S := First (Statements (Stats)); - while Present (S) loop - Update_Loop_Names (S); - Next (S); + Stmt := First (Statements (HSS)); + while Present (Stmt) loop + Update_Loop_Names (Stmt); + Next (Stmt); end loop; end if; end Make_Loop_Labels_Unique; diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index 56379465d0e..f8e909935cf 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -463,7 +463,7 @@ package body Layout is and then Known_Static_Esize (CT) and then not (Known_Alignment (CT) and then Alignment_In_Bits (CT) > - Standard_Long_Long_Integer_Size) + Standard_Long_Long_Integer_Size) then declare S : constant Uint := Esize (CT); diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 9ddfc970b25..24273645fa2 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -6198,8 +6198,8 @@ package body Sem_Ch12 is function Is_Defaulted (Param : Entity_Id) return Boolean; -- If the formql package has partly box-initialized formals, skip -- conformace check for these formals. Previously the code assumed - -- that boc initialization for a formal package applied to all - -- its formal parameters. + -- that boc initialization for a formal package applied to all its + -- formal parameters. function Same_Instantiated_Constant (E1, E2 : Entity_Id) return Boolean; -- The formal may come from a nested formal package, and the actual may @@ -6257,9 +6257,11 @@ package body Sem_Ch12 is function Is_Defaulted (Param : Entity_Id) return Boolean is Assoc : Node_Id; + begin - Assoc := First (Generic_Associations - (Parent (Associated_Formal_Package (Actual_Pack)))); + Assoc := + First (Generic_Associations (Parent + (Associated_Formal_Package (Actual_Pack)))); while Present (Assoc) loop if Nkind (Assoc) = N_Others_Choice then diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index ffd6f2311d4..234177f556f 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -9328,8 +9328,8 @@ package body Sem_Ch13 is Analyze (End_Decl_Expr); Set_Is_Frozen (Ent, True); - -- If the end of declarations comes before any other freeze - -- point, the Freeze_Expr is not analyzed: no check needed. + -- If the end of declarations comes before any other freeze point, + -- the Freeze_Expr is not analyzed: no check needed. if Analyzed (Freeze_Expr) and then not In_Instance then Check_Overloaded_Name; @@ -9340,13 +9340,10 @@ package body Sem_Ch13 is -- All other cases 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, - -- so analyze the expression now. - - if not Analyzed (Freeze_Expr) - and then Inside_A_Generic - then + if not Analyzed (Freeze_Expr) and then Inside_A_Generic then Preanalyze (Freeze_Expr); end if; diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index a1b98f03240..6f5126ea224 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -401,7 +401,7 @@ package body Sem_Ch7 is if not Generate_C_Code and then (Is_Inlined (Decl_Id) - or else Has_Pragma_Inline (Decl_Id)) + or else Has_Pragma_Inline (Decl_Id)) then Has_Referencer_Of_Non_Subprograms := True; @@ -423,7 +423,7 @@ package body Sem_Ch7 is if not Generate_C_Code and then (Is_Inlined (Decl_Id) - or else Has_Pragma_Inline (Decl_Id)) + or else Has_Pragma_Inline (Decl_Id)) then Has_Referencer_Of_Non_Subprograms := True; diff --git a/gcc/ada/styleg.adb b/gcc/ada/styleg.adb index fc2364b43f3..375664b2898 100644 --- a/gcc/ada/styleg.adb +++ b/gcc/ada/styleg.adb @@ -618,14 +618,18 @@ package body Styleg is begin if Style_Check_Mixed_Case_Decls then case Determine_Token_Casing is - when All_Upper_Case | All_Lower_Case => + when All_Lower_Case + | All_Upper_Case + => Error_Msg_SC -- CODEFIX ("(style) bad capitalization, mixed case required"); -- The Unknown case is something like A_B_C, which is both all -- caps and mixed case. - when Mixed_Case | Unknown => + when Mixed_Case + | Unknown + => null; -- OK end case; end if; -- 2.30.2