aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-09-09 23:55:55 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-26 04:58:54 -0400
commit9fdbcec69455b783f6d4d14f9abe2d33d6376be8 (patch)
treebf81c07a3b76c1a8cec09dc7b2b4c4bd4abb5c31 /gcc
parentacdd1bd4c6c17ba576891543e716eb040410d929 (diff)
downloadgcc-9fdbcec69455b783f6d4d14f9abe2d33d6376be8.zip
gcc-9fdbcec69455b783f6d4d14f9abe2d33d6376be8.tar.gz
gcc-9fdbcec69455b783f6d4d14f9abe2d33d6376be8.tar.bz2
[Ada] Cleanup SPARK expansion of aggregates with iterated_component_assoc
gcc/ada/ * exp_spark.adb (Expand_SPARK_Delta_Or_Update): Reuse local constant Expr and the Choice_List routine. (Expand_SPARK_N_Aggregate): Reuse local constant Expr.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_spark.adb10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb
index f6ef865..5e1fac2 100644
--- a/gcc/ada/exp_spark.adb
+++ b/gcc/ada/exp_spark.adb
@@ -227,7 +227,7 @@ package body Exp_SPARK is
if Nkind (Assoc) = N_Iterated_Component_Association then
Push_Scope (Scope (Defining_Identifier (Assoc)));
- Analyze_And_Resolve (Expression (Assoc), Comp_Type);
+ Analyze_And_Resolve (Expr, Comp_Type);
end if;
if Is_Scalar_Type (Comp_Type) then
@@ -240,11 +240,7 @@ package body Exp_SPARK is
End_Scope;
end if;
- Index :=
- First
- (if Nkind (Assoc) = N_Iterated_Component_Association
- then Discrete_Choices (Assoc)
- else Choices (Assoc));
+ Index := First (Choice_List (Assoc));
Index_Typ := First_Index (Typ);
while Present (Index) loop
@@ -399,7 +395,7 @@ package body Exp_SPARK is
Push_Scope (Scope (Defining_Identifier (Assoc)));
Enter_Name (Defining_Identifier (Assoc));
- Analyze_And_Resolve (Expression (Assoc), Comp_Type);
+ Analyze_And_Resolve (Expr, Comp_Type);
if Is_Scalar_Type (Comp_Type) then
Apply_Scalar_Range_Check (Expr, Comp_Type);