aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2023-03-13 12:26:09 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-26 09:29:15 +0200
commit8ba0b4cfeb518e4a4c5f3d3f8acc8cd700a05a93 (patch)
tree015f75f5e0d12baa9856265c09b081254fbdd494
parentf4e907d5ee52fffe7c6fb1256e65eb39c9313379 (diff)
downloadgcc-8ba0b4cfeb518e4a4c5f3d3f8acc8cd700a05a93.zip
gcc-8ba0b4cfeb518e4a4c5f3d3f8acc8cd700a05a93.tar.gz
gcc-8ba0b4cfeb518e4a4c5f3d3f8acc8cd700a05a93.tar.bz2
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.
-rw-r--r--gcc/ada/exp_aggr.adb12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index de4d5a7..bbc0f40 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;