diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-07-15 18:39:48 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-07-15 18:39:48 +0200 |
commit | a7ddd4a3ac9e48565dd3a0600358815ecbb5baab (patch) | |
tree | 41398d01826d2466e13b6bd6e8864de0dbc5618d /src/synth | |
parent | 5b243ebda9bb30724f14d5df6bb2f34956e6485b (diff) | |
download | ghdl-a7ddd4a3ac9e48565dd3a0600358815ecbb5baab.tar.gz ghdl-a7ddd4a3ac9e48565dd3a0600358815ecbb5baab.tar.bz2 ghdl-a7ddd4a3ac9e48565dd3a0600358815ecbb5baab.zip |
synth: handle anonymous subtypes in array subtypes.
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-decls.adb | 14 |
1 files changed, 10 insertions, 4 deletions
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); |