From 7c2a44aebbdcbd1c250b99541b25afd1dfcb60e8 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Wed, 21 Aug 2019 08:31:16 +0000 Subject: [PATCH] [Ada] Minor refactorings/reformattings 2019-08-21 Piotr Trojanek gcc/ada/ * einfo.adb (Is_Discriminal): Remove extra parens. (Is_Constant_Object): Simplify by reusing Ekind_In. (Is_Prival): Remove extra parens. * checks.adb, exp_ch4.adb, sem_ch3.adb, sem_spark.adb: Minor reformattings. From-SVN: r274790 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/checks.adb | 2 +- gcc/ada/einfo.adb | 12 +++++------- gcc/ada/exp_ch4.adb | 18 +++++++++--------- gcc/ada/sem_ch3.adb | 2 +- gcc/ada/sem_spark.adb | 2 +- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1b7a09dc57e..15fcd261f87 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2019-08-21 Piotr Trojanek + + * einfo.adb (Is_Discriminal): Remove extra parens. + (Is_Constant_Object): Simplify by reusing Ekind_In. + (Is_Prival): Remove extra parens. + * checks.adb, exp_ch4.adb, sem_ch3.adb, sem_spark.adb: Minor + reformattings. + 2019-08-21 Claire Dross * libgnat/a-cofove.ads (Vector): Add an Iterable aspect to allow diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 52b29fc9a3b..caee9ad7fd5 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -6994,7 +6994,7 @@ package body Checks is -- Next test for the case where the target type is within the bounds -- of the base type of the source type, since in this case we can - -- simply convert the bounds of the target type to this base bype + -- simply convert the bounds of the target type to this base type -- to do the test. -- [constraint_error when N not in diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 957bfe6e4cb..ebef3a0ca74 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -8032,10 +8032,8 @@ package body Einfo is ------------------------ function Is_Constant_Object (Id : E) return B is - K : constant Entity_Kind := Ekind (Id); begin - return - K = E_Constant or else K = E_In_Parameter or else K = E_Loop_Parameter; + return Ekind_In (Id, E_Constant, E_In_Parameter, E_Loop_Parameter); end Is_Constant_Object; ------------------- @@ -8053,8 +8051,8 @@ package body Einfo is function Is_Discriminal (Id : E) return B is begin - return (Ekind_In (Id, E_Constant, E_In_Parameter) - and then Present (Discriminal_Link (Id))); + return Ekind_In (Id, E_Constant, E_In_Parameter) + and then Present (Discriminal_Link (Id)); end Is_Discriminal; ---------------------- @@ -8181,8 +8179,8 @@ package body Einfo is function Is_Prival (Id : E) return B is begin - return (Ekind_In (Id, E_Constant, E_Variable) - and then Present (Prival_Link (Id))); + return Ekind_In (Id, E_Constant, E_Variable) + and then Present (Prival_Link (Id)); end Is_Prival; ---------------------------- diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index f28deac9b47..c288d6a79a7 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -2014,7 +2014,7 @@ package body Exp_Ch4 is -- If the array type is distinct from the type of the arguments, it -- is the full view of a private type. Apply an unchecked conversion - -- to insure that analysis of the call succeeds. + -- to ensure that analysis of the call succeeds. declare L, R : Node_Id; @@ -4254,7 +4254,7 @@ package body Exp_Ch4 is -- 'Last - First (instead of 'Length) because for large arrays computing -- 'Last -'First + 1 causes overflow. This is done without using the -- attribute 'Size_In_Storage_Elements (which malfunctions for large - -- sizes ???) + -- sizes ???). ------------------------- -- Rewrite_Coextension -- @@ -4333,7 +4333,7 @@ package body Exp_Ch4 is -- to compute 'Length since for large arrays 'Last -'First + 1 -- causes overflow; therefore we compute 'Last - 'First (which -- is not the exact number of components but it is valid for - -- the purpose of this runtime check on 32-bit targets) + -- the purpose of this runtime check on 32-bit targets). else declare @@ -4371,7 +4371,7 @@ package body Exp_Ch4 is (Make_Integer_Literal (Loc, J))))); -- Handle superflat arrays, i.e. arrays with such bounds - -- as 4 .. 2, to insure that the result is correct. + -- as 4 .. 2, to ensure that the result is correct. -- Generate: -- (if X'Last > X'First then X'Last - X'First else 0) @@ -4643,7 +4643,7 @@ package body Exp_Ch4 is -- The check on No_Initialization is used here to prevent generating -- this runtime check twice when the allocator is locally replaced by - -- the expander by another one. + -- the expander with another one. if Is_Array_Type (Etyp) and then not No_Initialization (N) then declare @@ -4683,11 +4683,11 @@ package body Exp_Ch4 is if Is_Constrained (Siz_Typ) and then Ekind (Siz_Typ) /= E_String_Literal_Subtype then - -- For CCG targets the largest array may have up to 2**31-1 - -- components (i.e. 2 Gigabytes if each array component is - -- 1-byte). This insures that fat pointer fields do not + -- For CCG targets, the largest array may have up to 2**31-1 + -- components (i.e. 2 gigabytes if each array component is + -- one byte). This ensures that fat pointer fields do not -- overflow, since they are 32-bit integer types, and also - -- insures that 'Length can be computed at run time. + -- ensures that 'Length can be computed at run time. if Modify_Tree_For_C then Cond := diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index edde68921cf..6af94191008 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -8818,7 +8818,7 @@ package body Sem_Ch3 is -- Indic can either be an N_Identifier if the subtype indication -- contains no constraint or an N_Subtype_Indication if the subtype - -- indecation has a constraint. In either case it can include an + -- indication has a constraint. In either case it can include an -- interface list. Indic := Subtype_Indication (Type_Def); diff --git a/gcc/ada/sem_spark.adb b/gcc/ada/sem_spark.adb index aea52143295..038c7cdd3e8 100644 --- a/gcc/ada/sem_spark.adb +++ b/gcc/ada/sem_spark.adb @@ -3092,7 +3092,7 @@ package body Sem_SPARK is -- Postconditions are checked for correct use of 'Old, but starting -- from the corresponding declaration, in order to avoid dealing with - -- with contracts on generic subprograms, which are not handled in + -- with contracts on generic subprograms which are not handled in -- GNATprove. when Pragma_Precondition -- 2.30.2