From a7ddd4a3ac9e48565dd3a0600358815ecbb5baab Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 15 Jul 2019 18:39:48 +0200 Subject: synth: handle anonymous subtypes in array subtypes. --- src/synth/synth-decls.adb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/synth/synth-decls.adb') diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb index add870a11..4866b112b 100644 --- a/src/synth/synth-decls.adb +++ b/src/synth/synth-decls.adb @@ -104,6 +104,14 @@ package body Synth.Decls is end case; end Synth_Range_Constraint; + procedure Synth_Subtype_Indication_If_Anonymous + (Syn_Inst : Synth_Instance_Acc; Atype : Node) is + begin + if Get_Type_Declarator (Atype) = Null_Node then + Synth_Subtype_Indication (Syn_Inst, Atype); + end if; + end Synth_Subtype_Indication_If_Anonymous; + procedure Synth_Subtype_Indication (Syn_Inst : Synth_Instance_Acc; Atype : Node) is begin @@ -113,10 +121,8 @@ package body Synth.Decls is -- The elaboration of an index constraint consists of the -- declaration of each of the discrete ranges in the index -- constraint in some order that is not defined by the language. - if Get_Array_Element_Constraint (Atype) /= Null_Node then - Synth_Subtype_Indication - (Syn_Inst, Get_Element_Subtype (Atype)); - end if; + Synth_Subtype_Indication_If_Anonymous + (Syn_Inst, Get_Element_Subtype (Atype)); declare St_Indexes : constant Iir_Flist := Get_Index_Subtype_List (Atype); -- cgit v1.2.3