[Ada] Minor style fixes in Max_Aggregate_Size
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 1 Jan 2021 12:25:33 +0000 (13:25 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 3 May 2021 09:28:29 +0000 (05:28 -0400)
gcc/ada/

* exp_aggr.adb (Max_Aggregate_Size): Add header boxes for nested
routines; move a local constant after nested subprogram bodies;
refill comment.

gcc/ada/exp_aggr.adb

index 00ca1e8..2d07abb 100644 (file)
@@ -8800,8 +8800,6 @@ package body Exp_Aggr is
      (N            : Node_Id;
       Default_Size : Nat := 5000) return Nat
    is
-      Typ : constant Entity_Id := Etype (N);
-
       function Use_Small_Size (N : Node_Id) return Boolean;
       --  True if we should return a very small size, which means large
       --  aggregates will be implemented as a loop when possible (potentially
@@ -8811,6 +8809,10 @@ package body Exp_Aggr is
       --  Return the context in which the aggregate appears, not counting
       --  qualified expressions and similar.
 
+      ------------------
+      -- Aggr_Context --
+      ------------------
+
       function Aggr_Context (N : Node_Id) return Node_Id is
          Result : Node_Id := Parent (N);
       begin
@@ -8828,6 +8830,10 @@ package body Exp_Aggr is
          return Result;
       end Aggr_Context;
 
+      --------------------
+      -- Use_Small_Size --
+      --------------------
+
       function Use_Small_Size (N : Node_Id) return Boolean is
          C : constant Node_Id := Aggr_Context (N);
          --  The decision depends on the context in which the aggregate occurs,
@@ -8858,11 +8864,15 @@ package body Exp_Aggr is
          end case;
       end Use_Small_Size;
 
+      --  Local variables
+
+      Typ : constant Entity_Id := Etype (N);
+
    --  Start of processing for Max_Aggregate_Size
 
    begin
-      --  We use a small limit in CodePeer mode where we favor loops
-      --  instead of thousands of single assignments (from large aggregates).
+      --  We use a small limit in CodePeer mode where we favor loops instead of
+      --  thousands of single assignments (from large aggregates).
 
       --  We also increase the limit to 2**24 (about 16 million) if
       --  Restrictions (No_Elaboration_Code) or Restrictions