aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2023-05-04 17:35:51 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-06-15 09:59:32 +0200
commitbe54247f74f54ec883e7677a78d6ec1bd97b1e76 (patch)
tree7d0cb8f1414d5f2180825959e7bd2bae64bd7ab5 /gcc
parent19e4d4c34c98d19d64eb2a5ed3d252685b9470be (diff)
downloadgcc-be54247f74f54ec883e7677a78d6ec1bd97b1e76.zip
gcc-be54247f74f54ec883e7677a78d6ec1bd97b1e76.tar.gz
gcc-be54247f74f54ec883e7677a78d6ec1bd97b1e76.tar.bz2
ada: Cleanup analysis of iterated component association
Cleanups related to analysis of iterated component association for GNATprove. gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Simplify comment. (Resolve_Iterated_Component_Association): Tune comment; change variable to constant.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_aggr.adb12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index c6063c7..3918946 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -1331,9 +1331,9 @@ package body Sem_Aggr is
-- In this event we do not resolve Expr unless expansion is disabled.
-- To know why, see the DELAYED COMPONENT RESOLUTION note above.
--
- -- NOTE: In the case of "... => <>", we pass the in the
- -- N_Component_Association node as Expr, since there is no Expression in
- -- that case, and we need a Sloc for the error message.
+ -- NOTE: In the case of "... => <>", we pass the N_Component_Association
+ -- node as Expr, since there is no Expression and we need a Sloc for the
+ -- error message.
procedure Resolve_Iterated_Component_Association
(N : Node_Id;
@@ -1790,7 +1790,7 @@ package body Sem_Aggr is
Choice : Node_Id;
Dummy : Boolean;
Scop : Entity_Id;
- Expr : Node_Id;
+ Expr : constant Node_Id := Expression (N);
-- Start of processing for Resolve_Iterated_Component_Association
@@ -1854,14 +1854,12 @@ package body Sem_Aggr is
Set_Scope (Id, Scop);
end if;
- -- Analyze expression without expansion, to verify legality.
+ -- Analyze expression without expansion, to verify legality.
-- When generating code, we then remove references to the index
-- variable, because the expression will be analyzed anew after
-- rewritting as a loop with a new index variable; when not
-- generating code we leave the analyzed expression as it is.
- Expr := Expression (N);
-
Dummy := Resolve_Aggr_Expr (Expr, Single_Elmt => False);
if Operating_Mode /= Check_Semantics then