]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Minor refactorings/reformattings
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2019 08:31:16 +0000 (08:31 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2019 08:31:16 +0000 (08:31 +0000)
2019-08-21  Piotr Trojanek  <trojanek@adacore.com>

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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274790 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/checks.adb
gcc/ada/einfo.adb
gcc/ada/exp_ch4.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_spark.adb

index 1b7a09dc57eb8c81fe7b6f8c36651bdc65060d2b..15fcd261f875c437cfed22b49f9d25aaff81b03f 100644 (file)
@@ -1,3 +1,11 @@
+2019-08-21  Piotr Trojanek  <trojanek@adacore.com>
+
+       * 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  <dross@adacore.com>
 
        * libgnat/a-cofove.ads (Vector): Add an Iterable aspect to allow
index 52b29fc9a3bdd8160168ddea2669573c3d512cb9..caee9ad7fd564d7fd214fad7ecbc742df1ad1c9d 100644 (file)
@@ -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
index 957bfe6e4cbb7139e4e798c2704847c8bb19ed96..ebef3a0ca74106e4b624af98912ed6623165a5af 100644 (file)
@@ -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;
 
    ----------------------------
index f28deac9b47f8f8547866acbcc65084367202c76..c288d6a79a7343d5d199f9c4b1217ba8a77d7140 100644 (file)
@@ -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 :=
index edde68921cf2446a80401f8b41a45ff30b75f9cf..6af941910085ec7bf303a78499fc6a91517267c9 100644 (file)
@@ -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);
index aea521432959319bdfdc5941c62eec8000912074..038c7cdd3e834d9692e8e32ca0104bf70c67661a 100644 (file)
@@ -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