[Ada] Ongoing work for AI12-0212: container aggregates

Pierre-Marie de Rodat derodat@adacore.com
Wed Jul 15 13:45:19 GMT 2020


This patch modifies the parser to recognize
iterated_element_associations, which may include a key_exprewsion to be
used in a named aggregate such as a map. The new syntactic node
N_Iterated_Element_Association is recognized throughout the compiler.
The patch also extends the analysis and expansion of positional and
named aggregates that include iterated_element_associations, (for now
without key_expressions).

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* par-ch4.adb (P_Iterated_Component_Association): Extended to
	recognzize the similar Iterated_Element_Association. This node
	is only generated when an explicit Key_Expression is given.
	Otherwise the distinction between the two iterated forms is done
	during semantic analysis.
	* sinfo.ads: New node N_Iterated_Element_Association, for
	Ada202x container aggregates.  New field Key_Expression.
	* sinfo.adb: Subprograms for new node and newn field.
	* sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
	the case where the Iteration_Scheme is an
	Iterator_Specification.
	* exp_aggr.adb (Wxpand_Iterated_Component): Handle a component
	with an Iterated_Component_Association, generate proper loop
	using given Iterator_Specification.
	* exp_util.adb (Insert_Axtions): Handle new node as other
	aggregate components.
	* sem.adb, sprint.adb: Handle new node.
	* tbuild.adb (Make_Implicit_Loop_Statement): Handle properly a
	loop with an Iterator_ specification.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 15753 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200715/20c9a75f/attachment.bin>


More information about the Gcc-patches mailing list