From: Piotr Trojanek Date: Fri, 1 Jan 2021 12:25:33 +0000 (+0100) Subject: [Ada] Minor style fixes in Max_Aggregate_Size X-Git-Tag: upstream/12.2.0~8323 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bcc150393e16baa1a1ce37b64e2fc5e1f7a38fc3;p=platform%2Fupstream%2Fgcc.git [Ada] Minor style fixes in Max_Aggregate_Size gcc/ada/ * exp_aggr.adb (Max_Aggregate_Size): Add header boxes for nested routines; move a local constant after nested subprogram bodies; refill comment. --- diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 00ca1e8..2d07abb 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -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