diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-07-24 18:31:11 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-07-25 11:28:49 +0200 |
commit | 04cd83fb46bee1e7a7b37be95bee73449af9c8b8 (patch) | |
tree | 3fe35d0bc6d4b1be8d81ad44df685057c221d2dc /src/vhdl/translate/trans-chap7.adb | |
parent | 4033dd795927a4953879bdc92d395788893a5468 (diff) | |
download | ghdl-04cd83fb46bee1e7a7b37be95bee73449af9c8b8.tar.gz ghdl-04cd83fb46bee1e7a7b37be95bee73449af9c8b8.tar.bz2 ghdl-04cd83fb46bee1e7a7b37be95bee73449af9c8b8.zip |
ortho: add unbounded records, rework array subtypes.
Diffstat (limited to 'src/vhdl/translate/trans-chap7.adb')
-rw-r--r-- | src/vhdl/translate/trans-chap7.adb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb index f7ea2cdf7..cd21d4755 100644 --- a/src/vhdl/translate/trans-chap7.adb +++ b/src/vhdl/translate/trans-chap7.adb @@ -348,12 +348,17 @@ package body Trans.Chap7 is function Create_String_Literal_Var (Str : Iir) return Var_Type is Str_Type : constant Iir := Get_Type (Str); + El_Type : constant Iir := Get_Element_Subtype (Str_Type); Arr_Type : O_Tnode; + Arr_St : O_Tnode; begin -- Create the string value. Arr_Type := Get_Info (Str_Type).B.Base_Type (Mode_Value); - return Create_String_Literal_Var_Inner - (Str, Get_Element_Subtype (Str_Type), Arr_Type); + Arr_St := New_Array_Subtype + (Arr_Type, + Get_Ortho_Type (El_Type, Mode_Value), + New_Index_Lit (Unsigned_64 (Get_String_Length (Str)))); + return Create_String_Literal_Var_Inner (Str, El_Type, Arr_St); end Create_String_Literal_Var; -- Some strings literal have an unconstrained array type, |