[Ada] Minor reformattings
authorHristian Kirtchev <kirtchev@adacore.com>
Mon, 3 Dec 2018 15:48:34 +0000 (15:48 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 3 Dec 2018 15:48:34 +0000 (15:48 +0000)
2018-12-03  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* checks.adb, exp_aggr.adb, exp_attr.adb, exp_ch3.adb,
exp_util.adb, exp_util.ads, repinfo.adb, sem_attr.adb,
sem_ch3.adb, sem_res.adb, sem_util.adb: Minor reformatting.

From-SVN: r266750

12 files changed:
gcc/ada/ChangeLog
gcc/ada/checks.adb
gcc/ada/exp_aggr.adb
gcc/ada/exp_attr.adb
gcc/ada/exp_ch3.adb
gcc/ada/exp_util.adb
gcc/ada/exp_util.ads
gcc/ada/repinfo.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_res.adb
gcc/ada/sem_util.adb

index 4a4fee4..5397c76 100644 (file)
@@ -1,3 +1,9 @@
+2018-12-03  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * checks.adb, exp_aggr.adb, exp_attr.adb, exp_ch3.adb,
+       exp_util.adb, exp_util.ads, repinfo.adb, sem_attr.adb,
+       sem_ch3.adb, sem_res.adb, sem_util.adb: Minor reformatting.
+
 2018-12-03  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_ch3.adb (Complete_Private_Subtype): Enhance comment.
index 89f26fa..8db6b0f 100644 (file)
@@ -4574,7 +4574,6 @@ package body Checks is
             Typ := Actual_Subtype (Entity (N));
          end if;
 
-         null;
       else
          Typ := Underlying_Type (Base_Type (Typ));
       end if;
index 2eff751..866abed 100644 (file)
@@ -4541,7 +4541,7 @@ package body Exp_Aggr is
 
                            declare
                               P : constant Entity_Id :=
-                                Cunit_Entity (Current_Sem_Unit);
+                                    Cunit_Entity (Current_Sem_Unit);
 
                            begin
                               --  Check if duplication is always OK and, if so,
index 2c2442a..67dd941 100644 (file)
@@ -6610,15 +6610,20 @@ package body Exp_Attr is
       --  also needs to be static, because we do some legality checks (e.g.
       --  for Thread_Local_Storage) after this transformation.
 
-      when Attribute_Ref | Attribute_To_Address => To_Address : declare
-         Is_Static : constant Boolean := Is_Static_Expression (N);
-      begin
-         Rewrite (N,
-           Unchecked_Convert_To (RTE (RE_Address),
-             Relocate_Node (First (Exprs))));
-         Set_Is_Static_Expression (N, Is_Static);
-         Analyze_And_Resolve (N, RTE (RE_Address));
-      end To_Address;
+      when Attribute_Ref
+         | Attribute_To_Address
+      =>
+         To_Address : declare
+            Is_Static : constant Boolean := Is_Static_Expression (N);
+
+         begin
+            Rewrite (N,
+              Unchecked_Convert_To (RTE (RE_Address),
+                Relocate_Node (First (Exprs))));
+            Set_Is_Static_Expression (N, Is_Static);
+
+            Analyze_And_Resolve (N, RTE (RE_Address));
+         end To_Address;
 
       ------------
       -- To_Any --
index 64cded5..65f6805 100644 (file)
@@ -6587,10 +6587,10 @@ package body Exp_Ch3 is
 
          if Is_Delayed_Aggregate (Expr_Q) then
 
-            --  An aggregate that must be built in place is not resolved
-            --  and expanded until the enclosing construct is expanded.
-            --  This will happen when the aggregqte is limited and the
-            --  declared object has a following address clause.
+            --  An aggregate that must be built in place is not resolved and
+            --  expanded until the enclosing construct is expanded. This will
+            --  happen when the aggregqte is limited and the declared object
+            --  has a following address clause.
 
             if Is_Limited_Type (Typ) and then not Analyzed (Expr) then
                Resolve (Expr, Typ);
index b5338d4..9fcf10c 100644 (file)
@@ -13414,7 +13414,10 @@ package body Exp_Util is
    --  See also Silly_Boolean_Array_Not_Test
 
    procedure Silly_Boolean_Array_Xor_Test
-     (N : Node_Id; R : Node_Id;  T : Entity_Id) is
+     (N : Node_Id;
+      R : Node_Id;
+      T : Entity_Id)
+   is
       Loc : constant Source_Ptr := Sloc (N);
       CT  : constant Entity_Id  := Component_Type (T);
 
@@ -13435,9 +13438,9 @@ package body Exp_Util is
         Make_Raise_Constraint_Error (Loc,
           Condition =>
             Make_And_Then (Loc,
-              Left_Opnd =>
+              Left_Opnd  =>
                 Make_And_Then (Loc,
-                  Left_Opnd =>
+                  Left_Opnd  =>
                     Convert_To (Standard_Boolean,
                       Make_Attribute_Reference (Loc,
                         Prefix         => New_Occurrence_Of (CT, Loc),
@@ -13450,7 +13453,7 @@ package body Exp_Util is
                         Attribute_Name => Name_Last))),
 
               Right_Opnd => Make_Non_Empty_Check (Loc, R)),
-          Reason => CE_Range_Check_Failed));
+          Reason    => CE_Range_Check_Failed));
    end Silly_Boolean_Array_Xor_Test;
 
    --------------------------
index 9b76ef8..ab48b74 100644 (file)
@@ -1141,7 +1141,9 @@ package Exp_Util is
    --  that a Constraint_Error exception be raised (RM 4.5.6(6)).
 
    procedure Silly_Boolean_Array_Xor_Test
-     (N : Node_Id; R : Node_Id;  T : Entity_Id);
+     (N : Node_Id;
+      R : Node_Id;
+      T : Entity_Id);
    --  N is the node for a boolean array XOR operation, T is the type of the
    --  array, and R is a copy of the right operand of N, required to prevent
    --  scope anomalies when unnesting is in effect. This routine deals with
index d0d46fc..3b41f93 100644 (file)
@@ -120,9 +120,9 @@ package body Repinfo is
    --  the current entity. Set True when a new entity is processed, and false
    --  when the blank line is output.
 
-   -------------------------------
-   --  Set of Relevant Entities --
-   -------------------------------
+   ------------------------------
+   -- Set of Relevant Entities --
+   ------------------------------
 
    Relevant_Entities_Size : constant := 4093;
    --  Number of headers in hash table
index 30cdc95..a9f9f93 100644 (file)
@@ -8284,7 +8284,7 @@ package body Sem_Attr is
 
          Analyze_And_Resolve (N, Standard_Boolean);
          Static := True;
-         Set_Is_Static_Expression (N, True);
+         Set_Is_Static_Expression (N);
       end Atomic_Always_Lock_Free;
 
       ---------
@@ -8737,7 +8737,7 @@ package body Sem_Attr is
 
          Analyze_And_Resolve (N, Standard_Boolean);
          Static := True;
-         Set_Is_Static_Expression (N, True);
+         Set_Is_Static_Expression (N);
       end Lock_Free;
 
       ----------
index 25d4000..d99370a 100644 (file)
@@ -4278,21 +4278,19 @@ package body Sem_Ch3 is
            and then Nkind (E) = N_Aggregate
            and then
              ((Present (Following_Address_Clause (N))
-                            and then not Ignore_Rep_Clauses)
+                 and then not Ignore_Rep_Clauses)
               or else Delayed_Aspect_Present)
          then
             Set_Etype (E, T);
 
-            --  If the aggregate is limited it will be built in place,
-            --  and its expansion is deferred until the object declaration
-            --  is expanded.
+            --  If the aggregate is limited it will be built in place, and its
+            --  expansion is deferred until the object declaration is expanded.
 
             if Is_Limited_Type (T) then
                Set_Expansion_Delayed (E);
             end if;
 
          else
-
             --  If the expression is a formal that is a "subprogram pointer"
             --  this is illegal in accessibility terms (see RM 3.10.2 (13.1/2)
             --  and AARM 3.10.2 (13.b/2)). Add an explicit conversion to force
@@ -4365,9 +4363,7 @@ package body Sem_Ch3 is
                Set_Current_Value (Id, E);
             end if;
 
-         elsif Is_Scalar_Type (T)
-            and then Is_OK_Static_Expression (E)
-         then
+         elsif Is_Scalar_Type (T) and then Is_OK_Static_Expression (E) then
             Set_Is_Known_Valid (Id);
 
          --  If it is a constant initialized with a valid nonstatic entity,
index b15be8e..ad0b5a0 100644 (file)
@@ -8457,39 +8457,44 @@ package body Sem_Res is
    ---------------------------
 
    procedure Resolve_If_Expression (N : Node_Id; Typ : Entity_Id) is
-      Condition : constant Node_Id := First (Expressions (N));
-      Then_Expr : Node_Id;
-      Else_Expr : Node_Id;
-
       procedure Apply_Check (Expr : Node_Id);
-      --  When a dependent expression is of a subtype different from the
-      --  context subtype, then insert a qualification  to ensure the
-      --  generation of a constraint check. This was previously done only
-      --  for scalar types.
+      --  When a dependent expression is of a subtype different from
+      --  the context subtype, then insert a qualification to ensure
+      --  the generation of a constraint check. This was previously
+      --  done only for scalar types.
 
       -----------------
       -- Apply_Check --
       -----------------
 
       procedure Apply_Check (Expr : Node_Id) is
-         Loc       : constant Source_Ptr := Sloc (Expr);
-         Expr_Type : constant Entity_Id := Etype (Expr);
-      begin
+         Expr_Typ : constant Entity_Id  := Etype (Expr);
+         Loc      : constant Source_Ptr := Sloc (Expr);
 
-         if Expr_Type /= Typ
-            and then not Is_Tagged_Type (Typ)
-            and then not Is_Access_Type (Typ)
-            and then Is_Constrained (Typ)
-            and then not Inside_A_Generic
+      begin
+         if Expr_Typ /= Typ
+           and then not Is_Tagged_Type (Typ)
+           and then not Is_Access_Type (Typ)
+           and then Is_Constrained (Typ)
+           and then not Inside_A_Generic
          then
             Rewrite (Expr,
-                 Make_Qualified_Expression (Loc,
-                   Subtype_Mark => New_Occurrence_Of (Typ, Loc),
-                   Expression   => Relocate_Node (Expr)));
+              Make_Qualified_Expression (Loc,
+                Subtype_Mark => New_Occurrence_Of (Typ, Loc),
+                Expression   => Relocate_Node (Expr)));
+
             Analyze_And_Resolve (Expr, Typ);
          end if;
       end Apply_Check;
 
+      --  Local variables
+
+      Condition : constant Node_Id := First (Expressions (N));
+      Else_Expr : Node_Id;
+      Then_Expr : Node_Id;
+
+   --  Start of processing for Resolve_If_Expression
+
    begin
       --  Defend against malformed expressions
 
index e3d7718..1d34d2a 100644 (file)
@@ -14160,7 +14160,6 @@ package body Sem_Util is
                --  Check for prefix being an aliased component???
 
                null;
-
             end if;
 
             --  A heap object is constrained by its initial value