From d22e878995eedc2efa45bbda640a5e984f03e224 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 21 Nov 2018 07:46:00 +0100 Subject: aggregates: WIP for arrays of unbounded elements. Fix #546 --- src/vhdl/translate/trans-chap3.adb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/vhdl/translate/trans-chap3.adb') diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 7d2db0b70..2d7a126a2 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -1045,6 +1045,7 @@ package body Trans.Chap3 is procedure Translate_Array_Subtype_Definition (Def : Iir_Array_Subtype_Definition; Parent_Type : Iir) is + El_Type : constant Iir := Get_Element_Subtype (Def); Info : constant Type_Info_Acc := Get_Info (Def); Pinfo : constant Type_Info_Acc := Get_Info (Parent_Type); @@ -1061,7 +1062,7 @@ package body Trans.Chap3 is Info.B := Pinfo.B; Info.S := Pinfo.S; if not Info.Type_Locally_Constrained - or else not Is_Static_Type (Get_Info (Get_Element_Subtype (Def))) + or else not Is_Static_Type (Get_Info (El_Type)) then -- This is a complex type as the size is not known at compile -- time. @@ -1070,7 +1071,10 @@ package body Trans.Chap3 is Info.Ortho_Ptr_Type := Pinfo.B.Base_Ptr_Type; else -- Length is known. Create a constrained array. - El_Constrained := Get_Array_Element_Constraint (Def) /= Null_Iir; + -- True if this definition has constrained the element. + El_Constrained := Is_Fully_Constrained_Type (El_Type) + and then not Is_Fully_Constrained_Type (Get_Element_Subtype + (Parent_Type)); Info.Type_Mode := Type_Mode_Static_Array; Info.Ortho_Type (Mode_Signal) := O_Tnode_Null; Info.Ortho_Ptr_Type (Mode_Signal) := O_Tnode_Null; -- cgit v1.2.3