From: Piotr Trojanek Date: Mon, 13 Mar 2023 11:26:09 +0000 (+0100) Subject: ada: Clean style in expansion of array aggregates X-Git-Tag: basepoints/gcc-15~8882 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ba0b4cfeb518e4a4c5f3d3f8acc8cd700a05a93;p=thirdparty%2Fgcc.git ada: Clean style in expansion of array aggregates Code cleanup only; semantics is unaffected. gcc/ada/ * exp_aggr.adb (Build_Array_Aggr_Code): Change variable to constant. (Check_Same_Aggr_Bounds): Fix style; remove unused initial value. --- diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index de4d5a785fc2..bbc0f408abce 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -2305,7 +2305,7 @@ package body Exp_Aggr is Assoc : Node_Id; Choice : Node_Id; Expr : Node_Id; - Typ : Entity_Id; + Typ : constant Entity_Id := Etype (N); Bounds : Range_Nodes; Low : Node_Id renames Bounds.First; @@ -2323,12 +2323,10 @@ package body Exp_Aggr is -- Start of processing for Build_Array_Aggr_Code begin - -- First before we start, a special case. if we have a bit packed + -- First before we start, a special case. If we have a bit packed -- array represented as a modular type, then clear the value to -- zero first, to ensure that unused bits are properly cleared. - Typ := Etype (N); - if Present (Typ) and then Is_Bit_Packed_Array (Typ) and then Is_Modular_Integer_Type (Packed_Array_Impl_Type (Typ)) @@ -6002,8 +6000,8 @@ package body Exp_Aggr is ---------------------------- procedure Check_Same_Aggr_Bounds (Sub_Aggr : Node_Id; Dim : Pos) is - Sub_Bounds : constant Range_Nodes - := Get_Index_Bounds (Aggregate_Bounds (Sub_Aggr)); + Sub_Bounds : constant Range_Nodes := + Get_Index_Bounds (Aggregate_Bounds (Sub_Aggr)); Sub_Lo : Node_Id renames Sub_Bounds.First; Sub_Hi : Node_Id renames Sub_Bounds.Last; -- The bounds of this specific subaggregate @@ -6015,7 +6013,7 @@ package body Exp_Aggr is Ind_Typ : constant Entity_Id := Aggr_Index_Typ (Dim); -- The index type for this dimension.xxx - Cond : Node_Id := Empty; + Cond : Node_Id; Assoc : Node_Id; Expr : Node_Id;