aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sinfo.ads
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2020-06-03 03:42:19 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-15 09:43:00 -0400
commit8092c19930b6cdf3087825f9063cb830cd2de479 (patch)
tree65d79907beeb22253433c45c9b4976287b039ccb /gcc/ada/sinfo.ads
parent1c5f82019ab50806ff1a23e5be8db864e8da131a (diff)
downloadgcc-8092c19930b6cdf3087825f9063cb830cd2de479.zip
gcc-8092c19930b6cdf3087825f9063cb830cd2de479.tar.gz
gcc-8092c19930b6cdf3087825f9063cb830cd2de479.tar.bz2
[Ada] Ongoing work for AI12-0212: container aggregates
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.
Diffstat (limited to 'gcc/ada/sinfo.ads')
-rw-r--r--gcc/ada/sinfo.ads36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 9ae8ce7..98dd462 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -4241,6 +4241,26 @@ package Sinfo is
-- Component_Associations (List2)
-- Etype (Node5-Sem)
+ ---------------------------------
+ -- 3.4.5 Comtainer_Aggregates --
+ ---------------------------------
+
+ -- N_Iterated_Element_Association
+ -- Key_Expression (Node1)
+ -- Iterator_Specification (Node2)
+ -- Expression (Node3)
+ -- Loop_Parameter_Specification (Node4)
+ -- Loop_Actions (List5-Sem)
+
+ -- Exactly one of Iterator_Specification or Loop_Parameter_
+ -- specification is present. If the Key_Expression is absent,
+ -- the construct is parsed as an Iterated_Component_Association,
+ -- and legality checks are performed during semantic analysis.
+
+ -- Both iterated associations are Ada2020 features that are
+ -- expanded during aggregate construction, and do not appear in
+ -- expanded code.
+
--------------------------------------------------
-- 4.4 Expression/Relation/Term/Factor/Primary --
--------------------------------------------------
@@ -8917,6 +8937,7 @@ package Sinfo is
N_Handled_Sequence_Of_Statements,
N_Index_Or_Discriminant_Constraint,
N_Iterated_Component_Association,
+ N_Iterated_Element_Association,
N_Itype_Reference,
N_Label,
N_Modular_Type_Definition,
@@ -9842,6 +9863,9 @@ package Sinfo is
function Itype
(N : Node_Id) return Entity_Id; -- Node1
+ function Key_Expression
+ (N : Node_Id) return Node_Id; -- Node1
+
function Kill_Range_Check
(N : Node_Id) return Boolean; -- Flag11
@@ -10951,6 +10975,9 @@ package Sinfo is
procedure Set_Itype
(N : Node_Id; Val : Entity_Id); -- Node1
+ procedure Set_Key_Expression
+ (N : Node_Id; Val : Node_Id); -- Node1
+
procedure Set_Kill_Range_Check
(N : Node_Id; Val : Boolean := True); -- Flag11
@@ -11901,6 +11928,13 @@ package Sinfo is
4 => True, -- Discrete_Choices (List4)
5 => True), -- Loop_Actions (List5-Sem);
+ N_Iterated_Element_Association =>
+ (1 => True, -- Key_expression
+ 2 => True, -- Iterator_Specification
+ 3 => True, -- Expression (Node3)
+ 4 => True, -- Loop_Parameter_Specification
+ 5 => True), -- Loop_Actions (List5-Sem);
+
N_Delta_Aggregate =>
(1 => False, -- Unused
2 => True, -- Component_Associations (List2)
@@ -13446,6 +13480,7 @@ package Sinfo is
pragma Inline (Iterator_Filter);
pragma Inline (Iteration_Scheme);
pragma Inline (Itype);
+ pragma Inline (Key_Expression);
pragma Inline (Kill_Range_Check);
pragma Inline (Last_Bit);
pragma Inline (Last_Name);
@@ -13812,6 +13847,7 @@ package Sinfo is
pragma Inline (Set_Iteration_Scheme);
pragma Inline (Set_Iterator_Specification);
pragma Inline (Set_Itype);
+ pragma Inline (Set_Key_Expression);
pragma Inline (Set_Kill_Range_Check);
pragma Inline (Set_Label_Construct);
pragma Inline (Set_Last_Bit);