diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-11-21 07:46:00 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-11-21 07:46:00 +0100 |
commit | d22e878995eedc2efa45bbda640a5e984f03e224 (patch) | |
tree | 6af43a928e241fe6d82481063e534909265eb06a /src/vhdl/translate | |
parent | 2971a32a22eb1364413a0df241d56beb748c3e99 (diff) | |
download | ghdl-d22e878995eedc2efa45bbda640a5e984f03e224.tar.gz ghdl-d22e878995eedc2efa45bbda640a5e984f03e224.tar.bz2 ghdl-d22e878995eedc2efa45bbda640a5e984f03e224.zip |
aggregates: WIP for arrays of unbounded elements.
Fix #546
Diffstat (limited to 'src/vhdl/translate')
-rw-r--r-- | src/vhdl/translate/trans-chap3.adb | 8 |
1 files changed, 6 insertions, 2 deletions
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; |