From 33df2265c63c44c83a5c44e577b8d286a40c9b53 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 13 Jan 2023 21:58:30 +0100 Subject: elab-vhdl_types(synth_record_type_definition): create unbounded record if the result is unbounded. --- src/synth/elab-vhdl_types.adb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/synth') diff --git a/src/synth/elab-vhdl_types.adb b/src/synth/elab-vhdl_types.adb index e44e50285..66efecde8 100644 --- a/src/synth/elab-vhdl_types.adb +++ b/src/synth/elab-vhdl_types.adb @@ -275,6 +275,7 @@ package body Elab.Vhdl_Types is El : Node; El_Type : Node; El_Typ : Type_Acc; + Bounded : Boolean; Parent_Els : Rec_El_Array_Acc; begin @@ -285,6 +286,7 @@ package body Elab.Vhdl_Types is Parent_Els := Parent_Typ.Rec; end if; + Bounded := True; for I in Flist_First .. Flist_Last (El_List) loop El := Get_Nth_Element (El_List, I); El_Type := Get_Type (El); @@ -299,13 +301,16 @@ package body Elab.Vhdl_Types is El_Typ := Synth_Subtype_Indication_If_Anonymous (Syn_Inst, El_Type); end if; + if Bounded and then not Is_Bounded_Type (El_Typ) then + Bounded := False; + end if; Rec_Els.E (Iir_Index32 (I + 1)).Typ := El_Typ; end loop; - if not Is_Fully_Constrained_Type (Def) then - return Create_Unbounded_Record (Rec_Els); - else + if Bounded then return Create_Record_Type (Rec_Els); + else + return Create_Unbounded_Record (Rec_Els); end if; end Synth_Record_Type_Definition; -- cgit v1.2.3