aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-loop-jam.cc
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2024-08-12 22:50:57 +0000
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-08-29 15:06:26 +0200
commita383d7bb732a38649a46696a2c4386d825054050 (patch)
tree158d33247b142dff30dccef73539cffb0d8770d2 /gcc/gimple-loop-jam.cc
parent567e36ccbae11857413ab6cd7d50856173d16405 (diff)
downloadgcc-a383d7bb732a38649a46696a2c4386d825054050.zip
gcc-a383d7bb732a38649a46696a2c4386d825054050.tar.gz
gcc-a383d7bb732a38649a46696a2c4386d825054050.tar.bz2
ada: Proper handling for iterator associations in array aggregates
The compiler was flagging type-mismatch errors on iterated component associations in array aggregates of form "for C in <iterator_name>", improperly requiring the type of the iterator to be the array index type. The parser can't distinguish whether the association is one involving an actual discrete choice vs. an iterator specification, and creates an N_Iterated_Component_Association with a Defining_Identifer and Discrete_Choices, and the analysis phase has to disambiguate this, determining whether to create an N_Iterator_Specification node for the association. A related change is to revise the similar code for iterated associations of container aggregates, to allow forms of iterator objects other than just function calls. gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Add loop over associations to locate N_Iterated_Component_Associations that do not have an Iterator_Specification, and if their Discrete_Choices list consists of a single choice, analyze it and if it's the name of an iterator object, then create an Iterator_Specification and associate it with the iterated component association. (Resolve_Iterated_Association): Replace test for function call with test of Is_Object_Reference, to handle other forms of iterator objects in container aggregates.
Diffstat (limited to 'gcc/gimple-loop-jam.cc')
0 files changed, 0 insertions, 0 deletions