From 7f8c1cd3675b0e30817d98e52740b918b4e970b0 Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Wed, 10 Jul 2019 09:01:33 +0000 Subject: [PATCH] [Ada] Minor reformatting 2019-07-10 Hristian Kirtchev gcc/ada/ * bindo-graphs.adb, bindo.adb, debug.adb, exp_ch6.adb, sem_ch10.adb, sem_ch13.adb, sem_ch3.adb, sem_ch4.adb, sem_ch6.adb, sem_ch7.adb, sem_res.adb, sem_spark.adb, sem_util.adb, warnsw.ads: Minor reformatting. From-SVN: r273335 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/bindo-graphs.adb | 36 ++++++++++++++++++------------------ gcc/ada/bindo.adb | 4 ++-- gcc/ada/debug.adb | 4 ++-- gcc/ada/exp_ch6.adb | 2 +- gcc/ada/sem_ch10.adb | 4 ++-- gcc/ada/sem_ch13.adb | 10 ++++++++-- gcc/ada/sem_ch3.adb | 5 ++--- gcc/ada/sem_ch4.adb | 22 +++++++++------------- gcc/ada/sem_ch6.adb | 2 +- gcc/ada/sem_ch7.adb | 10 +++++----- gcc/ada/sem_res.adb | 10 ++++------ gcc/ada/sem_spark.adb | 9 ++++----- gcc/ada/sem_util.adb | 4 +--- gcc/ada/warnsw.ads | 4 ++-- 15 files changed, 68 insertions(+), 65 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9d990336be7..f3f7217f95b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2019-07-10 Hristian Kirtchev + + * bindo-graphs.adb, bindo.adb, debug.adb, exp_ch6.adb, + sem_ch10.adb, sem_ch13.adb, sem_ch3.adb, sem_ch4.adb, + sem_ch6.adb, sem_ch7.adb, sem_res.adb, sem_spark.adb, + sem_util.adb, warnsw.ads: Minor reformatting. + 2019-07-10 Joffrey Huguet * libgnat/a-strbou.ads, libgnat/a-strfix.ads, diff --git a/gcc/ada/bindo-graphs.adb b/gcc/ada/bindo-graphs.adb index f1bfe470150..d254b1c45f0 100644 --- a/gcc/ada/bindo-graphs.adb +++ b/gcc/ada/bindo-graphs.adb @@ -1180,11 +1180,11 @@ package body Bindo.Graphs is -- * End vertices is the set of vertices that terminate a potential -- cycle. -- - -- * Deleted vertices is the set of vertices that have been expended + -- * Deleted vertices is the set of vertices that have been expanded -- during previous depth-first searches and should not be visited -- for the rest of the algorithm. -- - -- * Most_Significant_Edge is the current highest precedence edge on + -- * Most_Significant_Edge is the current highest-precedence edge on -- the path of the potential cycle. -- -- * Invocation_Edge_Count is the number of invocation edges on the @@ -1233,11 +1233,11 @@ package body Bindo.Graphs is -- * End_Vertices is the set of vertices that terminate a potential -- cycle. -- - -- * Deleted_Vertices is the set of vertices that have been expended + -- * Deleted_Vertices is the set of vertices that have been expanded -- during previous depth-first searches and should not be visited -- for the rest of the algorithm. -- - -- * Most_Significant_Edge is the current highest precedence edge on + -- * Most_Significant_Edge is the current highest-precedence edge on -- the path of the potential cycle. -- -- * Invocation_Edge_Count is the number of invocation edges on the @@ -2341,7 +2341,7 @@ package body Bindo.Graphs is elsif Cycle_Invs > Comp_Invs then return Lower_Precedence; - -- Prever a cycle with a higher path precedence + -- Prefer a cycle with a higher path precedence else return @@ -2684,7 +2684,7 @@ package body Bindo.Graphs is pragma Assert (Present (G)); -- The cycles of graph G are discovered using Tarjan's enumeration - -- of the elementary circuits of a directed graph algorithm. Do not + -- of the elementary circuits of a directed-graph algorithm. Do not -- modify this code unless you intimately understand the algorithm. -- -- The logic of the algorithm is split among the following routines: @@ -2698,7 +2698,7 @@ package body Bindo.Graphs is -- -- The original algorithm has been significantly modified in order to -- - -- * Accomodate the semantics of Elaborate_All and Elaborate_Body. + -- * Accommodate the semantics of Elaborate_All and Elaborate_Body. -- -- * Capture cycle paths as edges rather than vertices. -- @@ -2834,7 +2834,7 @@ package body Bindo.Graphs is -- the "complementary" vertex resulted in a cycle. Successor_Has_Cycle : Boolean; - -- This flag is set when visiting at least once successor of the + -- This flag is set when visiting at least one successor of the -- current vertex resulted in a cycle. begin @@ -2851,7 +2851,7 @@ package body Bindo.Graphs is Has_Cycle := False; -- Nothing to do when the limit on the number of saved cycles has - -- been reached. This protects against a combinatorial explostion + -- been reached. This protects against a combinatorial explosion -- in components with Elaborate_All cycles. if Cycle_Count >= Cycle_Limit then @@ -2859,8 +2859,8 @@ package body Bindo.Graphs is -- The vertex closes the circuit, thus resulting in a cycle. Save -- the cycle for later diagnostics. The initial invocation of the - -- routine always ignores the starting vertex to prevent a spurious - -- self cycle. + -- routine always ignores the starting vertex, to prevent a spurious + -- self-cycle. elsif not Is_Start_Vertex and then LGV_Sets.Contains (End_Vertices, Vertex) @@ -3053,7 +3053,7 @@ package body Bindo.Graphs is Visited_Set : LGV_Sets.Membership_Set := LGV_Sets.Nil; -- The "mark" array of Tarjan's algorithm. Since the original visits -- all vertices in increasing ordinal number 1 .. N, the array offers - -- a one to one mapping between a vertex and its "marked" state. The + -- a one-to-one mapping between a vertex and its "marked" state. The -- modified version however visits vertices within components, where -- their ordinals are not contiguous. Vertices are added to this set -- and treated as "marked". @@ -3091,7 +3091,7 @@ package body Bindo.Graphs is Vertex => Vertex, Elaborate_All_Active => Elaborate_All_Active); - -- The modified version maintans two addition attributes while + -- The modified version maintains two additional attributes while -- performing the depth-first search: -- -- * The most significant edge of the current potential cycle. @@ -3099,7 +3099,7 @@ package body Bindo.Graphs is -- * The number of invocation edges encountered along the path -- of the current potential cycle. -- - -- Both attributes are used in the heuristic which determines the + -- Both attributes are used in the heuristic that determines the -- importance of cycles. Find_Cycles_From_Vertex @@ -5243,7 +5243,7 @@ package body Bindo.Graphs is pragma Assert (Present (G)); pragma Assert (Present (Comp)); - -- Nothing to do when switch -d_t (output cycle detection trace + -- Nothing to do when switch -d_t (output cycle-detection trace -- information) is not in effect. if not Debug_Flag_Underscore_T then @@ -5279,7 +5279,7 @@ package body Bindo.Graphs is pragma Assert (Present (G)); pragma Assert (Present (Cycle)); - -- Nothing to do when switch -d_t (output cycle detection trace + -- Nothing to do when switch -d_t (output cycle-detection trace -- information) is not in effect. if not Debug_Flag_Underscore_T then @@ -5338,7 +5338,7 @@ package body Bindo.Graphs is Succ : constant Library_Graph_Vertex_Id := Successor (G, Edge); begin - -- Nothing to do when switch -d_t (output cycle detection trace + -- Nothing to do when switch -d_t (output cycle-detection trace -- information) is not in effect. if not Debug_Flag_Underscore_T then @@ -5387,7 +5387,7 @@ package body Bindo.Graphs is pragma Assert (Present (G)); pragma Assert (Present (Vertex)); - -- Nothing to do when switch -d_t (output cycle detection trace + -- Nothing to do when switch -d_t (output cycle-detection trace -- information) is not in effect. if not Debug_Flag_Underscore_T then diff --git a/gcc/ada/bindo.adb b/gcc/ada/bindo.adb index c4676178603..678f0098b98 100644 --- a/gcc/ada/bindo.adb +++ b/gcc/ada/bindo.adb @@ -322,9 +322,9 @@ package body Bindo is -- In addition, GNATbind does not create an edge to the body of the -- pragma argument. -- - -- -d_t Output cycle detection trace information + -- -d_t Output cycle-detection trace information -- - -- GNATbind outputs trace information on cycle detection activities + -- GNATbind outputs trace information on cycle-detection activities -- to standard output. -- -- -d_A Output ALI invocation tables diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 89bb7f8ca33..a81de09b19c 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -368,7 +368,7 @@ package body Debug is -- d_q -- d_r -- d_s - -- d_t Output cycle detection trace information + -- d_t Output cycle-detection trace information -- d_u -- d_v -- d_w @@ -1150,7 +1150,7 @@ package body Debug is -- elaboration order and no longer creates an implicit dependency on -- the body of the argument. - -- d_t GNATBIND output trace information of cycle detection activities to + -- d_t GNATBIND output trace information of cycle-detection activities to -- standard output. -- d_A GNATBIND output the contents of all ALI invocation-related tables diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 448f981b102..feeac7b0213 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -2594,8 +2594,8 @@ package body Exp_Ch6 is ---------------------------------- function Is_Class_Wide_Interface_Type (E : Entity_Id) return Boolean is - Typ : Entity_Id := E; DDT : Entity_Id; + Typ : Entity_Id := E; begin if Has_Non_Limited_View (Typ) then diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index c66296b18cd..c5d10f761b1 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -4355,7 +4355,7 @@ package body Sem_Ch10 is end; end if; - -- The With_Clause may be on a grand-child or one of its further + -- The With_Clause may be on a grandchild or one of its further -- descendants, which makes a child immediately visible. Examine -- ancestry to determine whether such a child exists. For example, -- if current unit is A.C, and with_clause is on A.X.Y.Z, then X @@ -4394,7 +4394,7 @@ package body Sem_Ch10 is -- Scan context of current unit, to check whether there is -- a with_clause on the same unit as a private with-clause -- on a parent, in which case child unit is visible. If the - -- unit is a grand-child, the same applies to its parent. + -- unit is a grandchild, the same applies to its parent. ---------------- -- In_Context -- diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 1ccbb52e18b..dc7f7744991 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -12551,6 +12551,10 @@ package body Sem_Ch13 is function Has_Generic_Parent (E : Entity_Id) return Boolean; -- Return True if any ancestor is a generic type + ------------------------ + -- Has_Generic_Parent -- + ------------------------ + function Has_Generic_Parent (E : Entity_Id) return Boolean is Ancestor_Type : Entity_Id := Etype (E); @@ -12562,10 +12566,12 @@ package body Sem_Ch13 is Ancestor_Type := Etype (Ancestor_Type); end loop; - return Present (Ancestor_Type) - and then Is_Generic_Type (Ancestor_Type); + return + Present (Ancestor_Type) and then Is_Generic_Type (Ancestor_Type); end Has_Generic_Parent; + -- Start of processing for Rep_Item_Too_Early + begin -- Cannot apply non-operational rep items to generic types diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 9e32cea6ad5..e936cbb0242 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -3651,7 +3651,7 @@ package body Sem_Ch3 is procedure Analyze_Object_Declaration (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Id : constant Entity_Id := Defining_Identifier (N); - Next_Decl : constant Node_Id := Next (N); + Next_Decl : constant Node_Id := Next (N); Act_T : Entity_Id; T : Entity_Id; @@ -4507,12 +4507,11 @@ package body Sem_Ch3 is declare Check : constant Node_Id := - Make_Predicate_Check (T, New_Occurrence_Of (Id, Loc)); + Make_Predicate_Check (T, New_Occurrence_Of (Id, Loc)); begin if No (Next_Decl) then Append_To (List_Containing (N), Check); - else Insert_Before (Next_Decl, Check); end if; diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 8806cbfa1ad..2b0a8edce99 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -6178,20 +6178,17 @@ package body Sem_Ch4 is and then Ekind (Entity (Name (N))) = E_Function and then Present (Homonym (Entity (Name (N)))) then - - -- A name may appear overloaded if it has a homonym, even if - -- that homonym is non-overloadable, in which case the overload - -- list is in fact empty. This specialized case deserves a - -- special message if the homonym is a child package. + -- A name may appear overloaded if it has a homonym, even if that + -- homonym is non-overloadable, in which case the overload list is + -- in fact empty. This specialized case deserves a special message + -- if the homonym is a child package. declare Nam : constant Node_Id := Name (N); H : constant Entity_Id := Homonym (Entity (Nam)); begin - if Ekind (H) = E_Package - and then Is_Child_Unit (H) - then + if Ekind (H) = E_Package and then Is_Child_Unit (H) then Error_Msg_Qual_Level := 2; Error_Msg_NE ("if an entity in package& is meant, ", Nam, H); Error_Msg_NE ("\use a fully qualified name", Nam, H); @@ -6208,9 +6205,9 @@ package body Sem_Ch4 is end if; end loop; - -- If all interpretations are procedures, this deserves a - -- more precise message. Ditto if this appears as the prefix - -- of a selected component, which may be a lexical error. + -- If all interpretations are procedures, this deserves a more + -- precise message. Ditto if this appears as the prefix of a + -- selected component, which may be a lexical error. Error_Msg_N ("\context requires function call, found procedure name", Nam); @@ -6226,8 +6223,7 @@ package body Sem_Ch4 is elsif Nkind (N) = N_Procedure_Call_Statement and then not Void_Interp_Seen then - Error_Msg_N ( - "\function name found in procedure call", Nam); + Error_Msg_N ("\function name found in procedure call", Nam); end if; All_Errors_Mode := Err_Mode; diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 119a2ee324b..e00cd57ea98 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -11342,7 +11342,7 @@ package body Sem_Ch6 is goto Continue; end if; - -- Protect against malformed parameter types. + -- Protect against malformed parameter types if Nkind (Ptype) not in N_Has_Entity then Formal_Type := Any_Type; diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index e97f15ebc00..e0d20ef844b 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -790,7 +790,7 @@ package body Sem_Ch7 is -- Deactivate expansion inside the body of ignored Ghost entities, -- as this code will ultimately be ignored. This avoids requiring the -- presence of run-time units which are not needed. Only do this for - -- user entities, as internally generated entitities might still need + -- user entities, as internally generated entities might still need -- to be expanded (e.g. those generated for types). if Present (Ignored_Ghost_Region) @@ -1063,7 +1063,7 @@ package body Sem_Ch7 is -- to the linker as their Is_Public flag is set to True. This proactive -- approach is necessary because an inlined or a generic body for which -- code is generated in other units may need to see these entities. Cut - -- down the number of global symbols that do not neet public visibility + -- down the number of global symbols that do not need public visibility -- as this has two beneficial effects: -- (1) It makes the compilation process more efficient. -- (2) It gives the code generator more leeway to optimize within each @@ -1883,7 +1883,7 @@ package body Sem_Ch7 is end if; -- Nested package specs that do not require bodies are not checked for - -- ineffective use clauses due to the possbility of subunits. This is + -- ineffective use clauses due to the possibility of subunits. This is -- because at this stage it is impossible to tell whether there will be -- a separate body. @@ -2261,7 +2261,7 @@ package body Sem_Ch7 is procedure Swap_Private_Dependents (Priv_Deps : Elist_Id); -- When the full view of a private type is made available, we do the -- same for its private dependents under proper visibility conditions. - -- When compiling a grand-chid unit this needs to be done recursively. + -- When compiling a grandchild unit this needs to be done recursively. ----------------------------- -- Swap_Private_Dependents -- @@ -3196,7 +3196,7 @@ package body Sem_Ch7 is E : Entity_Id; Requires_Body : Boolean := False; - -- Flag set when the unit has at least one construct that requries + -- Flag set when the unit has at least one construct that requires -- completion in a body. begin diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 4f56c53f1cc..db642f09f88 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -8471,14 +8471,12 @@ package body Sem_Res is Get_Next_Interp (I, It); end loop; - -- If expansion is active and this is wn inherited operation, + -- If expansion is active and this is an inherited operation, -- replace it with its ancestor. This must not be done during - -- preanalysis because the type nay not be frozen yet, as when - -- the context is a pre/post condition. + -- preanalysis because the type may not be frozen yet, as when + -- the context is a precondition or postcondition. - if Present (Alias (Entity (N))) - and then Expander_Active - then + if Present (Alias (Entity (N))) and then Expander_Active then Set_Entity (N, Alias (Entity (N))); end if; end; diff --git a/gcc/ada/sem_spark.adb b/gcc/ada/sem_spark.adb index af7dcd5f256..a9384b84c0d 100644 --- a/gcc/ada/sem_spark.adb +++ b/gcc/ada/sem_spark.adb @@ -1302,9 +1302,7 @@ package body Sem_SPARK is begin -- Only SPARK bodies are analyzed - if No (Prag) - or else Get_SPARK_Mode_From_Annotation (Prag) /= Opt.On - then + if No (Prag) or else Get_SPARK_Mode_From_Annotation (Prag) /= Opt.On then return; end if; @@ -1314,8 +1312,9 @@ package body Sem_SPARK is and then Is_Anonymous_Access_Type (Etype (Spec_Id)) and then not Is_Traversal_Function (Spec_Id) then - Error_Msg_N ("anonymous access type for result only allowed for " - & "traveral functions", Spec_Id); + Error_Msg_N + ("anonymous access type for result only allowed for traveral " + & "functions", Spec_Id); return; end if; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 1c266341dfd..e011c099c19 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -8716,9 +8716,7 @@ package body Sem_Util is if Is_Subprogram_Or_Generic_Subprogram (Subp) then Body_Id := Subprogram_Body_Entity (Subp); - elsif Is_Entry (Subp) - or else Is_Task_Type (Subp) - then + elsif Is_Entry (Subp) or else Is_Task_Type (Subp) then Body_Id := Corresponding_Body (Parent (Subp)); -- ??? It should be possible to retrieve the Refined_Global on the diff --git a/gcc/ada/warnsw.ads b/gcc/ada/warnsw.ads index 5875ecd0525..422f8df66da 100644 --- a/gcc/ada/warnsw.ads +++ b/gcc/ada/warnsw.ads @@ -41,8 +41,8 @@ package Warnsw is Warn_On_Anonymous_Allocators : Boolean := False; -- Warn when allocators for anonymous access types are present, which, -- although not illegal in Ada, may be confusing to users due to how - -- accessibility checks get generated. Off by default, modified by use of - -- -gnatw_a/_A and set as part of -gnatwa. + -- accessibility checks get generated. Off by default, modified by use + -- of -gnatw_a/_A and set as part of -gnatwa. Warn_On_Late_Primitives : Boolean := False; -- Warn when tagged type public primitives are defined after its private -- 2.30.2