aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-02-12 21:06:00 +0100
committerTristan Gingold <tgingold@free.fr>2017-02-12 21:07:48 +0100
commit748a8a732b96a8940bb1461502d1f1eaec0e9576 (patch)
treef5ca5d3d953cb32ae88144cc59088e1bd0df707c
parentfce8f87f735b5eadca4e6b85eefaecdb50159704 (diff)
downloadghdl-748a8a732b96a8940bb1461502d1f1eaec0e9576.tar.gz
ghdl-748a8a732b96a8940bb1461502d1f1eaec0e9576.tar.bz2
ghdl-748a8a732b96a8940bb1461502d1f1eaec0e9576.zip
vhdl08: unbounded records (WIP)
-rw-r--r--src/vhdl/iirs.ads2
-rw-r--r--src/vhdl/nodes_meta.adb354
-rw-r--r--src/vhdl/parse.adb1
-rw-r--r--src/vhdl/sem_types.adb4
-rw-r--r--src/vhdl/translate/trans-chap3.adb176
-rw-r--r--src/vhdl/translate/trans-chap4.adb5
-rw-r--r--src/vhdl/translate/trans-chap6.adb12
-rw-r--r--src/vhdl/translate/trans-chap7.adb88
-rw-r--r--src/vhdl/translate/trans-chap8.adb4
-rw-r--r--src/vhdl/translate/trans.adb2
-rw-r--r--src/vhdl/translate/trans.ads6
11 files changed, 395 insertions, 259 deletions
diff --git a/src/vhdl/iirs.ads b/src/vhdl/iirs.ads
index 1828227a2..2eae9d2db 100644
--- a/src/vhdl/iirs.ads
+++ b/src/vhdl/iirs.ads
@@ -1739,6 +1739,8 @@ package Iirs is
--
-- element_subtype_definition ::= subtype_indication
--
+ -- Get/Set_Parent (Field0)
+ --
-- Get/Set_Identifier (Field3)
--
-- Get/Set_Subtype_Indication (Field5)
diff --git a/src/vhdl/nodes_meta.adb b/src/vhdl/nodes_meta.adb
index b594c984e..7835abcd7 100644
--- a/src/vhdl/nodes_meta.adb
+++ b/src/vhdl/nodes_meta.adb
@@ -2891,6 +2891,7 @@ package body Nodes_Meta is
Field_Element_Position,
Field_Has_Identifier_List,
Field_Visible_Flag,
+ Field_Parent,
Field_Subtype_Indication,
Field_Type,
Field_Base_Element_Declaration,
@@ -4435,182 +4436,182 @@ package body Nodes_Meta is
Iir_Kind_Attribute_Declaration => 588,
Iir_Kind_Group_Template_Declaration => 594,
Iir_Kind_Group_Declaration => 601,
- Iir_Kind_Element_Declaration => 608,
- Iir_Kind_Non_Object_Alias_Declaration => 616,
- Iir_Kind_Psl_Declaration => 624,
- Iir_Kind_Psl_Endpoint_Declaration => 638,
- Iir_Kind_Terminal_Declaration => 644,
- Iir_Kind_Free_Quantity_Declaration => 653,
- Iir_Kind_Across_Quantity_Declaration => 665,
- Iir_Kind_Through_Quantity_Declaration => 677,
- Iir_Kind_Enumeration_Literal => 688,
- Iir_Kind_Function_Declaration => 713,
- Iir_Kind_Procedure_Declaration => 737,
- Iir_Kind_Function_Body => 747,
- Iir_Kind_Procedure_Body => 758,
- Iir_Kind_Object_Alias_Declaration => 769,
- Iir_Kind_File_Declaration => 783,
- Iir_Kind_Guard_Signal_Declaration => 796,
- Iir_Kind_Signal_Declaration => 813,
- Iir_Kind_Variable_Declaration => 826,
- Iir_Kind_Constant_Declaration => 840,
- Iir_Kind_Iterator_Declaration => 851,
- Iir_Kind_Interface_Constant_Declaration => 867,
- Iir_Kind_Interface_Variable_Declaration => 883,
- Iir_Kind_Interface_Signal_Declaration => 904,
- Iir_Kind_Interface_File_Declaration => 920,
- Iir_Kind_Interface_Type_Declaration => 930,
- Iir_Kind_Interface_Package_Declaration => 941,
- Iir_Kind_Interface_Function_Declaration => 958,
- Iir_Kind_Interface_Procedure_Declaration => 971,
- Iir_Kind_Signal_Attribute_Declaration => 974,
- Iir_Kind_Identity_Operator => 978,
- Iir_Kind_Negation_Operator => 982,
- Iir_Kind_Absolute_Operator => 986,
- Iir_Kind_Not_Operator => 990,
- Iir_Kind_Condition_Operator => 994,
- Iir_Kind_Reduction_And_Operator => 998,
- Iir_Kind_Reduction_Or_Operator => 1002,
- Iir_Kind_Reduction_Nand_Operator => 1006,
- Iir_Kind_Reduction_Nor_Operator => 1010,
- Iir_Kind_Reduction_Xor_Operator => 1014,
- Iir_Kind_Reduction_Xnor_Operator => 1018,
- Iir_Kind_And_Operator => 1023,
- Iir_Kind_Or_Operator => 1028,
- Iir_Kind_Nand_Operator => 1033,
- Iir_Kind_Nor_Operator => 1038,
- Iir_Kind_Xor_Operator => 1043,
- Iir_Kind_Xnor_Operator => 1048,
- Iir_Kind_Equality_Operator => 1053,
- Iir_Kind_Inequality_Operator => 1058,
- Iir_Kind_Less_Than_Operator => 1063,
- Iir_Kind_Less_Than_Or_Equal_Operator => 1068,
- Iir_Kind_Greater_Than_Operator => 1073,
- Iir_Kind_Greater_Than_Or_Equal_Operator => 1078,
- Iir_Kind_Match_Equality_Operator => 1083,
- Iir_Kind_Match_Inequality_Operator => 1088,
- Iir_Kind_Match_Less_Than_Operator => 1093,
- Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1098,
- Iir_Kind_Match_Greater_Than_Operator => 1103,
- Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1108,
- Iir_Kind_Sll_Operator => 1113,
- Iir_Kind_Sla_Operator => 1118,
- Iir_Kind_Srl_Operator => 1123,
- Iir_Kind_Sra_Operator => 1128,
- Iir_Kind_Rol_Operator => 1133,
- Iir_Kind_Ror_Operator => 1138,
- Iir_Kind_Addition_Operator => 1143,
- Iir_Kind_Substraction_Operator => 1148,
- Iir_Kind_Concatenation_Operator => 1153,
- Iir_Kind_Multiplication_Operator => 1158,
- Iir_Kind_Division_Operator => 1163,
- Iir_Kind_Modulus_Operator => 1168,
- Iir_Kind_Remainder_Operator => 1173,
- Iir_Kind_Exponentiation_Operator => 1178,
- Iir_Kind_Function_Call => 1186,
- Iir_Kind_Aggregate => 1193,
- Iir_Kind_Parenthesis_Expression => 1196,
- Iir_Kind_Qualified_Expression => 1200,
- Iir_Kind_Type_Conversion => 1205,
- Iir_Kind_Allocator_By_Expression => 1209,
- Iir_Kind_Allocator_By_Subtype => 1214,
- Iir_Kind_Selected_Element => 1220,
- Iir_Kind_Dereference => 1225,
- Iir_Kind_Implicit_Dereference => 1230,
- Iir_Kind_Slice_Name => 1237,
- Iir_Kind_Indexed_Name => 1243,
- Iir_Kind_Psl_Expression => 1245,
- Iir_Kind_Sensitized_Process_Statement => 1266,
- Iir_Kind_Process_Statement => 1286,
- Iir_Kind_Concurrent_Simple_Signal_Assignment => 1297,
- Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1308,
- Iir_Kind_Concurrent_Selected_Signal_Assignment => 1320,
- Iir_Kind_Concurrent_Assertion_Statement => 1328,
- Iir_Kind_Concurrent_Procedure_Call_Statement => 1335,
- Iir_Kind_Psl_Assert_Statement => 1348,
- Iir_Kind_Psl_Cover_Statement => 1361,
- Iir_Kind_Block_Statement => 1374,
- Iir_Kind_If_Generate_Statement => 1384,
- Iir_Kind_Case_Generate_Statement => 1393,
- Iir_Kind_For_Generate_Statement => 1402,
- Iir_Kind_Component_Instantiation_Statement => 1412,
- Iir_Kind_Psl_Default_Clock => 1416,
- Iir_Kind_Simple_Simultaneous_Statement => 1423,
- Iir_Kind_Generate_Statement_Body => 1434,
- Iir_Kind_If_Generate_Else_Clause => 1439,
- Iir_Kind_Simple_Signal_Assignment_Statement => 1448,
- Iir_Kind_Conditional_Signal_Assignment_Statement => 1457,
- Iir_Kind_Selected_Waveform_Assignment_Statement => 1467,
- Iir_Kind_Null_Statement => 1471,
- Iir_Kind_Assertion_Statement => 1478,
- Iir_Kind_Report_Statement => 1484,
- Iir_Kind_Wait_Statement => 1492,
- Iir_Kind_Variable_Assignment_Statement => 1498,
- Iir_Kind_Conditional_Variable_Assignment_Statement => 1504,
- Iir_Kind_Return_Statement => 1510,
- Iir_Kind_For_Loop_Statement => 1519,
- Iir_Kind_While_Loop_Statement => 1527,
- Iir_Kind_Next_Statement => 1533,
- Iir_Kind_Exit_Statement => 1539,
- Iir_Kind_Case_Statement => 1547,
- Iir_Kind_Procedure_Call_Statement => 1553,
- Iir_Kind_If_Statement => 1562,
- Iir_Kind_Elsif => 1567,
- Iir_Kind_Character_Literal => 1575,
- Iir_Kind_Simple_Name => 1583,
- Iir_Kind_Selected_Name => 1592,
- Iir_Kind_Operator_Symbol => 1598,
- Iir_Kind_Reference_Name => 1601,
- Iir_Kind_Selected_By_All_Name => 1607,
- Iir_Kind_Parenthesis_Name => 1612,
- Iir_Kind_External_Constant_Name => 1620,
- Iir_Kind_External_Signal_Name => 1628,
- Iir_Kind_External_Variable_Name => 1636,
- Iir_Kind_Package_Pathname => 1640,
- Iir_Kind_Absolute_Pathname => 1641,
- Iir_Kind_Relative_Pathname => 1642,
- Iir_Kind_Pathname_Element => 1647,
- Iir_Kind_Base_Attribute => 1649,
- Iir_Kind_Subtype_Attribute => 1654,
- Iir_Kind_Element_Attribute => 1659,
- Iir_Kind_Left_Type_Attribute => 1664,
- Iir_Kind_Right_Type_Attribute => 1669,
- Iir_Kind_High_Type_Attribute => 1674,
- Iir_Kind_Low_Type_Attribute => 1679,
- Iir_Kind_Ascending_Type_Attribute => 1684,
- Iir_Kind_Image_Attribute => 1690,
- Iir_Kind_Value_Attribute => 1696,
- Iir_Kind_Pos_Attribute => 1702,
- Iir_Kind_Val_Attribute => 1708,
- Iir_Kind_Succ_Attribute => 1714,
- Iir_Kind_Pred_Attribute => 1720,
- Iir_Kind_Leftof_Attribute => 1726,
- Iir_Kind_Rightof_Attribute => 1732,
- Iir_Kind_Delayed_Attribute => 1741,
- Iir_Kind_Stable_Attribute => 1750,
- Iir_Kind_Quiet_Attribute => 1759,
- Iir_Kind_Transaction_Attribute => 1768,
- Iir_Kind_Event_Attribute => 1772,
- Iir_Kind_Active_Attribute => 1776,
- Iir_Kind_Last_Event_Attribute => 1780,
- Iir_Kind_Last_Active_Attribute => 1784,
- Iir_Kind_Last_Value_Attribute => 1788,
- Iir_Kind_Driving_Attribute => 1792,
- Iir_Kind_Driving_Value_Attribute => 1796,
- Iir_Kind_Behavior_Attribute => 1796,
- Iir_Kind_Structure_Attribute => 1796,
- Iir_Kind_Simple_Name_Attribute => 1803,
- Iir_Kind_Instance_Name_Attribute => 1808,
- Iir_Kind_Path_Name_Attribute => 1813,
- Iir_Kind_Left_Array_Attribute => 1820,
- Iir_Kind_Right_Array_Attribute => 1827,
- Iir_Kind_High_Array_Attribute => 1834,
- Iir_Kind_Low_Array_Attribute => 1841,
- Iir_Kind_Length_Array_Attribute => 1848,
- Iir_Kind_Ascending_Array_Attribute => 1855,
- Iir_Kind_Range_Array_Attribute => 1862,
- Iir_Kind_Reverse_Range_Array_Attribute => 1869,
- Iir_Kind_Attribute_Name => 1878
+ Iir_Kind_Element_Declaration => 609,
+ Iir_Kind_Non_Object_Alias_Declaration => 617,
+ Iir_Kind_Psl_Declaration => 625,
+ Iir_Kind_Psl_Endpoint_Declaration => 639,
+ Iir_Kind_Terminal_Declaration => 645,
+ Iir_Kind_Free_Quantity_Declaration => 654,
+ Iir_Kind_Across_Quantity_Declaration => 666,
+ Iir_Kind_Through_Quantity_Declaration => 678,
+ Iir_Kind_Enumeration_Literal => 689,
+ Iir_Kind_Function_Declaration => 714,
+ Iir_Kind_Procedure_Declaration => 738,
+ Iir_Kind_Function_Body => 748,
+ Iir_Kind_Procedure_Body => 759,
+ Iir_Kind_Object_Alias_Declaration => 770,
+ Iir_Kind_File_Declaration => 784,
+ Iir_Kind_Guard_Signal_Declaration => 797,
+ Iir_Kind_Signal_Declaration => 814,
+ Iir_Kind_Variable_Declaration => 827,
+ Iir_Kind_Constant_Declaration => 841,
+ Iir_Kind_Iterator_Declaration => 852,
+ Iir_Kind_Interface_Constant_Declaration => 868,
+ Iir_Kind_Interface_Variable_Declaration => 884,
+ Iir_Kind_Interface_Signal_Declaration => 905,
+ Iir_Kind_Interface_File_Declaration => 921,
+ Iir_Kind_Interface_Type_Declaration => 931,
+ Iir_Kind_Interface_Package_Declaration => 942,
+ Iir_Kind_Interface_Function_Declaration => 959,
+ Iir_Kind_Interface_Procedure_Declaration => 972,
+ Iir_Kind_Signal_Attribute_Declaration => 975,
+ Iir_Kind_Identity_Operator => 979,
+ Iir_Kind_Negation_Operator => 983,
+ Iir_Kind_Absolute_Operator => 987,
+ Iir_Kind_Not_Operator => 991,
+ Iir_Kind_Condition_Operator => 995,
+ Iir_Kind_Reduction_And_Operator => 999,
+ Iir_Kind_Reduction_Or_Operator => 1003,
+ Iir_Kind_Reduction_Nand_Operator => 1007,
+ Iir_Kind_Reduction_Nor_Operator => 1011,
+ Iir_Kind_Reduction_Xor_Operator => 1015,
+ Iir_Kind_Reduction_Xnor_Operator => 1019,
+ Iir_Kind_And_Operator => 1024,
+ Iir_Kind_Or_Operator => 1029,
+ Iir_Kind_Nand_Operator => 1034,
+ Iir_Kind_Nor_Operator => 1039,
+ Iir_Kind_Xor_Operator => 1044,
+ Iir_Kind_Xnor_Operator => 1049,
+ Iir_Kind_Equality_Operator => 1054,
+ Iir_Kind_Inequality_Operator => 1059,
+ Iir_Kind_Less_Than_Operator => 1064,
+ Iir_Kind_Less_Than_Or_Equal_Operator => 1069,
+ Iir_Kind_Greater_Than_Operator => 1074,
+ Iir_Kind_Greater_Than_Or_Equal_Operator => 1079,
+ Iir_Kind_Match_Equality_Operator => 1084,
+ Iir_Kind_Match_Inequality_Operator => 1089,
+ Iir_Kind_Match_Less_Than_Operator => 1094,
+ Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1099,
+ Iir_Kind_Match_Greater_Than_Operator => 1104,
+ Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1109,
+ Iir_Kind_Sll_Operator => 1114,
+ Iir_Kind_Sla_Operator => 1119,
+ Iir_Kind_Srl_Operator => 1124,
+ Iir_Kind_Sra_Operator => 1129,
+ Iir_Kind_Rol_Operator => 1134,
+ Iir_Kind_Ror_Operator => 1139,
+ Iir_Kind_Addition_Operator => 1144,
+ Iir_Kind_Substraction_Operator => 1149,
+ Iir_Kind_Concatenation_Operator => 1154,
+ Iir_Kind_Multiplication_Operator => 1159,
+ Iir_Kind_Division_Operator => 1164,
+ Iir_Kind_Modulus_Operator => 1169,
+ Iir_Kind_Remainder_Operator => 1174,
+ Iir_Kind_Exponentiation_Operator => 1179,
+ Iir_Kind_Function_Call => 1187,
+ Iir_Kind_Aggregate => 1194,
+ Iir_Kind_Parenthesis_Expression => 1197,
+ Iir_Kind_Qualified_Expression => 1201,
+ Iir_Kind_Type_Conversion => 1206,
+ Iir_Kind_Allocator_By_Expression => 1210,
+ Iir_Kind_Allocator_By_Subtype => 1215,
+ Iir_Kind_Selected_Element => 1221,
+ Iir_Kind_Dereference => 1226,
+ Iir_Kind_Implicit_Dereference => 1231,
+ Iir_Kind_Slice_Name => 1238,
+ Iir_Kind_Indexed_Name => 1244,
+ Iir_Kind_Psl_Expression => 1246,
+ Iir_Kind_Sensitized_Process_Statement => 1267,
+ Iir_Kind_Process_Statement => 1287,
+ Iir_Kind_Concurrent_Simple_Signal_Assignment => 1298,
+ Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1309,
+ Iir_Kind_Concurrent_Selected_Signal_Assignment => 1321,
+ Iir_Kind_Concurrent_Assertion_Statement => 1329,
+ Iir_Kind_Concurrent_Procedure_Call_Statement => 1336,
+ Iir_Kind_Psl_Assert_Statement => 1349,
+ Iir_Kind_Psl_Cover_Statement => 1362,
+ Iir_Kind_Block_Statement => 1375,
+ Iir_Kind_If_Generate_Statement => 1385,
+ Iir_Kind_Case_Generate_Statement => 1394,
+ Iir_Kind_For_Generate_Statement => 1403,
+ Iir_Kind_Component_Instantiation_Statement => 1413,
+ Iir_Kind_Psl_Default_Clock => 1417,
+ Iir_Kind_Simple_Simultaneous_Statement => 1424,
+ Iir_Kind_Generate_Statement_Body => 1435,
+ Iir_Kind_If_Generate_Else_Clause => 1440,
+ Iir_Kind_Simple_Signal_Assignment_Statement => 1449,
+ Iir_Kind_Conditional_Signal_Assignment_Statement => 1458,
+ Iir_Kind_Selected_Waveform_Assignment_Statement => 1468,
+ Iir_Kind_Null_Statement => 1472,
+ Iir_Kind_Assertion_Statement => 1479,
+ Iir_Kind_Report_Statement => 1485,
+ Iir_Kind_Wait_Statement => 1493,
+ Iir_Kind_Variable_Assignment_Statement => 1499,
+ Iir_Kind_Conditional_Variable_Assignment_Statement => 1505,
+ Iir_Kind_Return_Statement => 1511,
+ Iir_Kind_For_Loop_Statement => 1520,
+ Iir_Kind_While_Loop_Statement => 1528,
+ Iir_Kind_Next_Statement => 1534,
+ Iir_Kind_Exit_Statement => 1540,
+ Iir_Kind_Case_Statement => 1548,
+ Iir_Kind_Procedure_Call_Statement => 1554,
+ Iir_Kind_If_Statement => 1563,
+ Iir_Kind_Elsif => 1568,
+ Iir_Kind_Character_Literal => 1576,
+ Iir_Kind_Simple_Name => 1584,
+ Iir_Kind_Selected_Name => 1593,
+ Iir_Kind_Operator_Symbol => 1599,
+ Iir_Kind_Reference_Name => 1602,
+ Iir_Kind_Selected_By_All_Name => 1608,
+ Iir_Kind_Parenthesis_Name => 1613,
+ Iir_Kind_External_Constant_Name => 1621,
+ Iir_Kind_External_Signal_Name => 1629,
+ Iir_Kind_External_Variable_Name => 1637,
+ Iir_Kind_Package_Pathname => 1641,
+ Iir_Kind_Absolute_Pathname => 1642,
+ Iir_Kind_Relative_Pathname => 1643,
+ Iir_Kind_Pathname_Element => 1648,
+ Iir_Kind_Base_Attribute => 1650,
+ Iir_Kind_Subtype_Attribute => 1655,
+ Iir_Kind_Element_Attribute => 1660,
+ Iir_Kind_Left_Type_Attribute => 1665,
+ Iir_Kind_Right_Type_Attribute => 1670,
+ Iir_Kind_High_Type_Attribute => 1675,
+ Iir_Kind_Low_Type_Attribute => 1680,
+ Iir_Kind_Ascending_Type_Attribute => 1685,
+ Iir_Kind_Image_Attribute => 1691,
+ Iir_Kind_Value_Attribute => 1697,
+ Iir_Kind_Pos_Attribute => 1703,
+ Iir_Kind_Val_Attribute => 1709,
+ Iir_Kind_Succ_Attribute => 1715,
+ Iir_Kind_Pred_Attribute => 1721,
+ Iir_Kind_Leftof_Attribute => 1727,
+ Iir_Kind_Rightof_Attribute => 1733,
+ Iir_Kind_Delayed_Attribute => 1742,
+ Iir_Kind_Stable_Attribute => 1751,
+ Iir_Kind_Quiet_Attribute => 1760,
+ Iir_Kind_Transaction_Attribute => 1769,
+ Iir_Kind_Event_Attribute => 1773,
+ Iir_Kind_Active_Attribute => 1777,
+ Iir_Kind_Last_Event_Attribute => 1781,
+ Iir_Kind_Last_Active_Attribute => 1785,
+ Iir_Kind_Last_Value_Attribute => 1789,
+ Iir_Kind_Driving_Attribute => 1793,
+ Iir_Kind_Driving_Value_Attribute => 1797,
+ Iir_Kind_Behavior_Attribute => 1797,
+ Iir_Kind_Structure_Attribute => 1797,
+ Iir_Kind_Simple_Name_Attribute => 1804,
+ Iir_Kind_Instance_Name_Attribute => 1809,
+ Iir_Kind_Path_Name_Attribute => 1814,
+ Iir_Kind_Left_Array_Attribute => 1821,
+ Iir_Kind_Right_Array_Attribute => 1828,
+ Iir_Kind_High_Array_Attribute => 1835,
+ Iir_Kind_Low_Array_Attribute => 1842,
+ Iir_Kind_Length_Array_Attribute => 1849,
+ Iir_Kind_Ascending_Array_Attribute => 1856,
+ Iir_Kind_Range_Array_Attribute => 1863,
+ Iir_Kind_Reverse_Range_Array_Attribute => 1870,
+ Iir_Kind_Attribute_Name => 1879
);
function Get_Fields (K : Iir_Kind) return Fields_Array
@@ -9127,6 +9128,7 @@ package body Nodes_Meta is
| Iir_Kind_Attribute_Declaration
| Iir_Kind_Group_Template_Declaration
| Iir_Kind_Group_Declaration
+ | Iir_Kind_Element_Declaration
| Iir_Kind_Non_Object_Alias_Declaration
| Iir_Kind_Psl_Declaration
| Iir_Kind_Psl_Endpoint_Declaration
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb
index ae5cd960e..0b696a8d8 100644
--- a/src/vhdl/parse.adb
+++ b/src/vhdl/parse.adb
@@ -2161,6 +2161,7 @@ package body Parse is
loop
El := Create_Iir (Iir_Kind_Element_Declaration);
Set_Location (El);
+ Set_Parent (El, Res);
if First = Null_Iir then
First := El;
end if;
diff --git a/src/vhdl/sem_types.adb b/src/vhdl/sem_types.adb
index b21ad3ad2..9861cf6c3 100644
--- a/src/vhdl/sem_types.adb
+++ b/src/vhdl/sem_types.adb
@@ -1383,9 +1383,11 @@ package body Sem_Types is
New_El := Create_Iir (Iir_Kind_Element_Declaration);
Location_Copy (New_El, El);
+ Set_Parent (New_El, Dst);
Set_Identifier (New_El, Get_Identifier (El));
Set_Type (New_El, Get_Type (El));
- Set_Base_Element_Declaration (New_El, El);
+ Set_Base_Element_Declaration (New_El,
+ Get_Base_Element_Declaration (El));
Append_Element (New_El_List, New_El);
end loop;
end Copy_Record_Elements_Declaration_List;
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb
index f013b33c8..900b3775c 100644
--- a/src/vhdl/translate/trans-chap3.adb
+++ b/src/vhdl/translate/trans-chap3.adb
@@ -32,6 +32,8 @@ with Translation;
package body Trans.Chap3 is
use Trans.Helpers;
+ function Unbox_Record (Arr : Mnode) return Mnode;
+
function Create_Static_Type_Definition_Type_Range (Def : Iir)
return O_Cnode;
procedure Create_Scalar_Type_Range (Def : Iir; Target : O_Lnode);
@@ -81,11 +83,23 @@ package body Trans.Chap3 is
end if;
end Finish_Type_Definition;
- procedure Create_Size_Var (Def : Iir)
- is
- Info : constant Type_Info_Acc := Get_Info (Def);
+ procedure Set_Complex_Type (Info : Type_Info_Acc; Need_Builder : Boolean) is
begin
+ pragma Assert (Info.C = null);
Info.C := new Complex_Type_Arr_Info;
+ -- No size variable for unconstrained array type.
+ for Mode in Object_Kind_Type loop
+ Info.C (Mode).Builder_Need_Func := Need_Builder;
+ end loop;
+ end Set_Complex_Type;
+
+ procedure Copy_Complex_Type (Dest : Type_Info_Acc; Src : Type_Info_Acc) is
+ begin
+ Dest.C := new Complex_Type_Arr_Info'(Src.C.all);
+ end Copy_Complex_Type;
+
+ procedure Create_Size_Var (Def : Iir; Info : Type_Info_Acc) is
+ begin
Info.C (Mode_Value).Size_Var := Create_Var
(Create_Var_Identifier ("SIZE"), Ghdl_Index_Type);
if Get_Has_Signal_Flag (Def) then
@@ -117,7 +131,7 @@ package body Trans.Chap3 is
Subprgs.Add_Subprg_Instance_Interfaces
(Interface_List, Info.C (Kind).Builder_Instance);
case Info.Type_Mode is
- when Type_Mode_Fat_Array =>
+ when Type_Mode_Unbounded =>
Ptype := Info.B.Base_Ptr_Type (Kind);
when Type_Mode_Record =>
Ptype := Info.Ortho_Ptr_Type (Kind);
@@ -128,7 +142,7 @@ package body Trans.Chap3 is
(Interface_List, Info.C (Kind).Builder_Base_Param,
Get_Identifier ("base_ptr"), Ptype);
-- Add parameter for array bounds.
- if Info.Type_Mode = Type_Mode_Fat_Array then
+ if Info.Type_Mode in Type_Mode_Unbounded then
New_Interface_Decl
(Interface_List, Info.C (Kind).Builder_Bound_Param,
Get_Identifier ("bound"), Info.B.Bounds_Ptr_Type);
@@ -139,7 +153,6 @@ package body Trans.Chap3 is
function Gen_Call_Type_Builder (Var : Mnode; Var_Type : Iir) return O_Enode
is
Kind : constant Object_Kind_Type := Get_Object_Kind (Var);
- Tinfo : constant Type_Info_Acc := Get_Info (Var_Type);
Binfo : constant Type_Info_Acc := Get_Info (Get_Base_Type (Var_Type));
Assoc : O_Assoc_List;
begin
@@ -148,19 +161,12 @@ package body Trans.Chap3 is
Subprgs.Add_Subprg_Instance_Assoc
(Assoc, Binfo.C (Kind).Builder_Instance);
- case Tinfo.Type_Mode is
- when Type_Mode_Record
- | Type_Mode_Array =>
- New_Association (Assoc, M2Addr (Var));
- when Type_Mode_Fat_Array =>
- -- Note: a fat array can only be at the top of a complex type;
- -- the bounds must have been set.
- New_Association (Assoc, M2Addr (Chap3.Get_Composite_Base (Var)));
- when others =>
- raise Internal_Error;
- end case;
+ -- Note: a fat array can only be at the top of a complex type;
+ -- the bounds must have been set.
+ New_Association
+ (Assoc, M2Addr (Chap3.Unbox_Record (Chap3.Get_Composite_Base (Var))));
- if Tinfo.Type_Mode in Type_Mode_Arrays then
+ if Binfo.Type_Mode in Type_Mode_Unbounded then
New_Association (Assoc, M2Addr (Chap3.Get_Array_Bounds (Var)));
end if;
@@ -813,13 +819,8 @@ package body Trans.Chap3 is
El_Tinfo := Get_Info (Get_Element_Subtype (Def));
if Is_Complex_Type (El_Tinfo) then
-- This is a complex type.
- Info.C := new Complex_Type_Arr_Info;
-- No size variable for unconstrained array type.
- for Mode in Object_Kind_Type loop
- Info.C (Mode).Size_Var := Null_Var;
- Info.C (Mode).Builder_Need_Func :=
- El_Tinfo.C (Mode).Builder_Need_Func;
- end loop;
+ Set_Complex_Type (Info, El_Tinfo.C (Mode_Value).Builder_Need_Func);
end if;
Info.Type_Incomplete := False;
end Translate_Array_Type_Definition;
@@ -871,13 +872,17 @@ package body Trans.Chap3 is
Info.Ortho_Type := Binfo.B.Base_Ptr_Type;
Info.Ortho_Ptr_Type := Binfo.B.Base_Ptr_Type;
- Create_Size_Var (Def);
+ -- If the base type need a builder, so does the subtype.
+ if Is_Complex_Type (Binfo)
+ and then Binfo.C (Mode_Value).Builder_Need_Func
+ then
+ Copy_Complex_Type (Info, Binfo);
+ else
+ Set_Complex_Type (Info, False);
+ end if;
- for Mode in Object_Kind_Type loop
- Info.C (Mode).Builder_Need_Func :=
- Is_Complex_Type (Binfo)
- and then Binfo.C (Mode).Builder_Need_Func;
- end loop;
+ -- Type is bounded, but not statically.
+ Create_Size_Var (Def, Info);
else
-- Length is known. Create a constrained array.
Info.Ortho_Type (Mode_Signal) := O_Tnode_Null;
@@ -1149,17 +1154,20 @@ package body Trans.Chap3 is
Translate_Record_Type_Bounds (Def, Info);
Create_Unbounded_Type_Fat_Pointer (Info);
Finish_Type_Definition (Info);
+
+ -- There are internal fields for unbounded records, so the objects
+ -- must be built.
+ Set_Complex_Type (Info, True);
else
Info.Type_Mode := Type_Mode_Record;
Info.Ortho_Type := Info.B.Base_Type;
Finish_Type_Definition (Info);
Info.B.Base_Ptr_Type := Info.Ortho_Ptr_Type;
- end if;
- if Need_Size then
- Create_Size_Var (Def);
- Info.C (Mode_Value).Builder_Need_Func := True;
- Info.C (Mode_Signal).Builder_Need_Func := True;
+ if Need_Size then
+ Set_Complex_Type (Info, True);
+ Create_Size_Var (Def, Info);
+ end if;
end if;
end Translate_Record_Type;
@@ -1168,6 +1176,7 @@ package body Trans.Chap3 is
Type_Mark : constant Iir := Get_Type
(Get_Named_Entity (Get_Subtype_Type_Mark (Def)));
Base_Type : constant Iir := Get_Base_Type (Def);
+ Type_Mark_Info : constant Type_Info_Acc := Get_Info (Type_Mark);
Info : constant Type_Info_Acc := Get_Info (Def);
El_List : constant Iir_List := Get_Elements_Declaration_List (Def);
El_Tm_List : constant Iir_List :=
@@ -1205,7 +1214,7 @@ package body Trans.Chap3 is
end loop;
-- By default, use the same representation as the type mark.
- Info.all := Get_Info (Type_Mark).all;
+ Info.all := Type_Mark_Info.all;
Info.S := Ortho_Info_Subtype_Record_Init;
if Get_Constraint_State (Def) /= Fully_Constrained
@@ -1218,9 +1227,16 @@ package body Trans.Chap3 is
return;
end if;
+ -- Record is constrained.
+ Info.Type_Mode := Type_Mode_Record;
+
+ -- Base type is complex (unbounded record)
+ Copy_Complex_Type (Info, Type_Mark_Info);
+
-- Then create the record type.
if Get_Type_Staticness (Def) = Locally then
- Info.Type_Mode := Type_Mode_Record;
+ -- Record is locally constrained: create a new record, containing the
+ -- base record and all the fields.
Info.Ortho_Type (Mode_Signal) := O_Tnode_Null;
for Kind in Mode_Value .. Type_To_Last_Object_Kind (Def) loop
Start_Record_Type (Rec);
@@ -1249,7 +1265,14 @@ package body Trans.Chap3 is
end loop;
Finish_Type_Definition (Info);
+ else
+ -- Not locally constrained, but still constrained.
+ -- Objects have to be dynamically allocated and built.
+ Create_Size_Var (Def, Info);
+ Info.Ortho_Type := Info.B.Base_Type;
+ Info.Ortho_Ptr_Type := Info.B.Base_Ptr_Type;
end if;
+
if With_Vars then
Create_Composite_Subtype_Bounds_Var (Def, False);
end if;
@@ -1266,6 +1289,7 @@ package body Trans.Chap3 is
Off_Var : O_Dnode;
Ptr_Var : O_Dnode;
Off_Val : O_Enode;
+ Sub_Bound : Mnode;
El_Type : Iir;
Inner_Type : Iir;
El_Tinfo : Type_Info_Acc;
@@ -1273,6 +1297,7 @@ package body Trans.Chap3 is
Start_Subprogram_Body (Info.C (Kind).Builder_Func);
Subprgs.Start_Subprg_Instance_Use (Info.C (Kind).Builder_Instance);
+ -- Declare OFF, the offset variable
New_Var_Decl (Off_Var, Get_Identifier ("off"), O_Storage_Local,
Ghdl_Index_Type);
@@ -1289,8 +1314,10 @@ package body Trans.Chap3 is
exit when El = Null_Iir;
El_Type := Get_Type (El);
El_Tinfo := Get_Info (El_Type);
- if Is_Complex_Type (El_Tinfo) then
- -- Complex type.
+ if Is_Complex_Type (El_Tinfo)
+ or else Is_Unbounded_Type (El_Tinfo)
+ then
+ -- Complex or unbounded type. Field is an offset.
-- Align on the innermost array element (which should be
-- a record) for Mode_Value. No need to align for signals,
@@ -1308,7 +1335,9 @@ package body Trans.Chap3 is
Get_Info (El).Field_Node (Kind)),
New_Obj_Value (Off_Var));
- if El_Tinfo.C (Kind).Builder_Need_Func then
+ if Is_Complex_Type (El_Tinfo)
+ and then El_Tinfo.C (Kind).Builder_Need_Func
+ then
-- This type needs a builder, call it.
Start_Declare_Stmt;
New_Var_Decl
@@ -1329,17 +1358,35 @@ package body Trans.Chap3 is
Finish_Declare_Stmt;
else
+ if Is_Unbounded_Type (El_Tinfo) then
+ Sub_Bound := Bounds_To_Element_Bounds
+ (Dp2M (Info.C (Kind).Builder_Bound_Param,
+ Info, Mode_Value,
+ Info.B.Bounds_Type, Info.B.Bounds_Ptr_Type),
+ El);
+ else
+ Sub_Bound := Mnode_Null;
+ end if;
+
-- Allocate memory.
New_Assign_Stmt
(New_Obj (Off_Var),
New_Dyadic_Op
(ON_Add_Ov,
New_Obj_Value (Off_Var),
- New_Value (Get_Var (El_Tinfo.C (Kind).Size_Var))));
+ Get_Subtype_Size (El_Type, Sub_Bound, Kind)));
end if;
end if;
end loop;
- New_Return_Stmt (New_Value (Get_Var (Info.C (Kind).Size_Var)));
+
+ -- Align the size to the object alignment.
+ Off_Val := New_Obj_Value (Off_Var);
+ if Kind = Mode_Value then
+ Off_Val := Realign (Off_Val, Def);
+ end if;
+
+ New_Return_Stmt (Off_Val);
+
Subprgs.Finish_Subprg_Instance_Use (Info.C (Kind).Builder_Instance);
Finish_Subprogram_Body;
end Create_Record_Type_Builder;
@@ -2627,16 +2674,19 @@ package body Trans.Chap3 is
function Get_Composite_Base (Arr : Mnode) return Mnode
is
Info : constant Type_Info_Acc := Get_Type_Info (Arr);
- Kind : constant Object_Kind_Type := Get_Object_Kind (Arr);
begin
case Info.Type_Mode is
when Type_Mode_Unbounded_Array
| Type_Mode_Unbounded_Record =>
- return Lp2M
- (New_Selected_Element (M2Lv (Arr),
- Info.B.Base_Field (Kind)),
- Info, Kind,
- Info.B.Base_Type (Kind), Info.B.Base_Ptr_Type (Kind));
+ declare
+ Kind : constant Object_Kind_Type := Get_Object_Kind (Arr);
+ begin
+ return Lp2M
+ (New_Selected_Element (M2Lv (Arr),
+ Info.B.Base_Field (Kind)),
+ Info, Kind,
+ Info.B.Base_Type (Kind), Info.B.Base_Ptr_Type (Kind));
+ end;
when Type_Mode_Array
| Type_Mode_Record =>
return Arr;
@@ -2645,6 +2695,36 @@ package body Trans.Chap3 is
end case;
end Get_Composite_Base;
+ function Unbox_Record (Arr : Mnode) return Mnode
+ is
+ Info : constant Type_Info_Acc := Get_Type_Info (Arr);
+ begin
+ case Info.Type_Mode is
+ when Type_Mode_Unbounded_Array
+ | Type_Mode_Unbounded_Record =>
+ return Arr;
+ when Type_Mode_Array =>
+ return Arr;
+ when Type_Mode_Record =>
+ declare
+ Kind : constant Object_Kind_Type := Get_Object_Kind (Arr);
+ Box_Field : constant O_Fnode := Info.S.Box_Field (Kind);
+ begin
+ if Box_Field /= O_Fnode_Null then
+ -- Unbox the record.
+ return Lv2M (New_Selected_Element (M2Lv (Arr), Box_Field),
+ Info, Kind,
+ Info.B.Base_Type (Kind),
+ Info.B.Base_Ptr_Type (Kind));
+ else
+ return Arr;
+ end if;
+ end;
+ when others =>
+ raise Internal_Error;
+ end case;
+ end Unbox_Record;
+
function Get_Bounds_Acc_Base
(Acc : O_Enode; D_Type : Iir) return O_Enode
is
diff --git a/src/vhdl/translate/trans-chap4.adb b/src/vhdl/translate/trans-chap4.adb
index c4e956e67..669f83d25 100644
--- a/src/vhdl/translate/trans-chap4.adb
+++ b/src/vhdl/translate/trans-chap4.adb
@@ -440,14 +440,13 @@ package body Trans.Chap4 is
Init_Array_Object (Obj, Obj_Type);
when Type_Mode_Records =>
declare
+ List : constant Iir_List :=
+ Get_Elements_Declaration_List (Obj_Type);
Sobj : Mnode;
El : Iir_Element_Declaration;
- List : Iir_List;
begin
Open_Temp;
Sobj := Stabilize (Obj);
- List := Get_Elements_Declaration_List
- (Get_Base_Type (Obj_Type));
for I in Natural loop
El := Get_Nth_Element (List, I);
exit when El = Null_Iir;
diff --git a/src/vhdl/translate/trans-chap6.adb b/src/vhdl/translate/trans-chap6.adb
index 5d6c87993..769b23bc4 100644
--- a/src/vhdl/translate/trans-chap6.adb
+++ b/src/vhdl/translate/trans-chap6.adb
@@ -31,16 +31,14 @@ with Trans_Decls; use Trans_Decls;
package body Trans.Chap6 is
use Trans.Helpers;
- function Get_Array_Bound_Length (Arr : Mnode;
- Arr_Type : Iir;
- Dim : Natural)
- return O_Enode
+ function Get_Array_Bound_Length
+ (Arr : Mnode; Arr_Type : Iir; Dim : Natural) return O_Enode
is
- Index_Type : constant Iir := Get_Index_Type (Arr_Type, Dim - 1);
- Tinfo : constant Type_Info_Acc := Get_Info (Arr_Type);
- Constraint : Iir;
+ Tinfo : constant Type_Info_Acc := Get_Info (Arr_Type);
+ Index_Type, Constraint : Iir;
begin
if Tinfo.Type_Locally_Constrained then
+ Index_Type := Get_Index_Type (Arr_Type, Dim - 1);
Constraint := Get_Range_Constraint (Index_Type);
return New_Lit (Chap7.Translate_Static_Range_Length (Constraint));
else
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb
index dfc0f221b..5102e4cb3 100644
--- a/src/vhdl/translate/trans-chap7.adb
+++ b/src/vhdl/translate/trans-chap7.adb
@@ -768,10 +768,68 @@ package body Trans.Chap7 is
return Res;
end Convert_Constrained_To_Unconstrained;
- function Convert_Array_To_Thin_Array
+ -- Innert procedure for Convert_Unconstrained_To_Constrained.
+ procedure Convert_Unconstrained_To_Constrained_Check
+ (Bounds : Mnode; Expr_Type : Iir; Atype : Iir; Failure_Label : O_Snode)
+ is
+ Stable_Bounds : Mnode;
+ begin
+ Open_Temp;
+ Stable_Bounds := Stabilize (Bounds);
+ case Get_Kind (Expr_Type) is
+ when Iir_Kind_Array_Type_Definition
+ | Iir_Kind_Array_Subtype_Definition =>
+ declare
+ Expr_Indexes : constant Iir_List :=
+ Get_Index_Subtype_List (Expr_Type);
+ begin
+ for I in 1 .. Get_Nbr_Elements (Expr_Indexes) loop
+ Gen_Exit_When
+ (Failure_Label,
+ New_Compare_Op
+ (ON_Neq,
+ M2E (Chap3.Range_To_Length
+ (Chap3.Bounds_To_Range
+ (Stable_Bounds, Expr_Type, I))),
+ Chap6.Get_Array_Bound_Length
+ (T2M (Atype, Mode_Value), Atype, I),
+ Ghdl_Bool_Type));
+ end loop;
+ end;
+ when Iir_Kind_Record_Type_Definition
+ | Iir_Kind_Record_Subtype_Definition =>
+ declare
+ Expr_Els : constant Iir_List :=
+ Get_Elements_Declaration_List (Expr_Type);
+ Atype_Els : constant Iir_List :=
+ Get_Elements_Declaration_List (Atype);
+ Expr_El, Atype_El : Iir;
+ Expr_El_Type, Atype_El_Type : Iir;
+ begin
+ for I in Natural loop
+ Expr_El := Get_Nth_Element (Expr_Els, I);
+ exit when Expr_El = Null_Iir;
+ Atype_El := Get_Nth_Element (Atype_Els, I);
+ Expr_El_Type := Get_Type (Expr_El);
+ Atype_El_Type := Get_Type (Atype_El);
+ if Expr_El_Type /= Atype_El_Type then
+ Convert_Unconstrained_To_Constrained_Check
+ (Chap3.Bounds_To_Element_Bounds
+ (Stable_Bounds, Expr_El),
+ Expr_El_Type, Atype_El_Type, Failure_Label);
+ end if;
+ end loop;
+ end;
+ when others =>
+ Error_Kind ("convert_unconstrained_to_constrained_check",
+ Expr_Type);
+ end case;
+ Close_Temp;
+ end Convert_Unconstrained_To_Constrained_Check;
+
+ function Convert_Unconstrained_To_Constrained
(Expr : Mnode; Expr_Type : Iir; Atype : Iir; Loc : Iir) return Mnode
is
- Expr_Indexes : constant Iir_List := Get_Index_Subtype_List (Expr_Type);
Expr_Stable : Mnode;
Success_Label : O_Snode;
Failure_Label : O_Snode;
@@ -782,25 +840,20 @@ package body Trans.Chap7 is
-- Check each dimension.
Start_Loop_Stmt (Success_Label);
Start_Loop_Stmt (Failure_Label);
- for I in 1 .. Get_Nbr_Elements (Expr_Indexes) loop
- Gen_Exit_When
- (Failure_Label,
- New_Compare_Op
- (ON_Neq,
- Chap6.Get_Array_Bound_Length
- (Expr_Stable, Expr_Type, I),
- Chap6.Get_Array_Bound_Length
- (T2M (Atype, Get_Object_Kind (Expr_Stable)), Atype, I),
- Ghdl_Bool_Type));
- end loop;
+
+ Convert_Unconstrained_To_Constrained_Check
+ (Chap3.Get_Array_Bounds (Expr_Stable), Expr_Type,
+ Atype, Failure_Label);
+
New_Exit_Stmt (Success_Label);
+
Finish_Loop_Stmt (Failure_Label);
Chap6.Gen_Bound_Error (Loc);
Finish_Loop_Stmt (Success_Label);
Close_Temp;
return Chap3.Get_Composite_Base (Expr_Stable);
- end Convert_Array_To_Thin_Array;
+ end Convert_Unconstrained_To_Constrained;
function Translate_Implicit_Array_Conversion
(Expr : Mnode; Expr_Type : Iir; Res_Type : Iir; Loc : Iir) return Mnode
@@ -846,7 +899,7 @@ package body Trans.Chap7 is
return Expr;
else
-- Unbounded/bounded array to bounded array.
- return Convert_Array_To_Thin_Array
+ return Convert_Unconstrained_To_Constrained
(Expr, Expr_Type, Res_Type, Loc);
end if;
when others =>
@@ -857,7 +910,6 @@ package body Trans.Chap7 is
function Translate_Implicit_Record_Conversion
(Expr : Mnode; Expr_Type : Iir; Res_Type : Iir; Loc : Iir) return Mnode
is
- pragma Unreferenced (Loc);
Ainfo : Type_Info_Acc;
Einfo : Type_Info_Acc;
begin
@@ -885,8 +937,8 @@ package body Trans.Chap7 is
case Einfo.Type_Mode is
when Type_Mode_Unbounded_Record =>
-- unbounded to bounded.
- -- TODO: need to check bounds.
- raise Internal_Error;
+ return Convert_Unconstrained_To_Constrained
+ (Expr, Expr_Type, Res_Type, Loc);
when Type_Mode_Record =>
-- bounded to bounded.
-- TODO: likewise ?
diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb
index 171eb9231..9fdb5852e 100644
--- a/src/vhdl/translate/trans-chap8.adb
+++ b/src/vhdl/translate/trans-chap8.adb
@@ -2339,7 +2339,7 @@ package body Trans.Chap8 is
if Has_Value_Field then
for Mode in Mode_Value .. Object_Kind loop
- if Ftype_Info.Type_Mode = Type_Mode_Fat_Array then
+ if Ftype_Info.Type_Mode in Type_Mode_Unbounded then
-- For unconstrained arrays/records:
-- - the array (if the actual is constrained and not
-- complex) - TODO
@@ -2679,7 +2679,7 @@ package body Trans.Chap8 is
declare
Param_Var : Var_Type;
begin
- if Ftype_Info.Type_Mode = Type_Mode_Fat_Array then
+ if Ftype_Info.Type_Mode in Type_Mode_Unbounded then
Param_Var := Assoc_Info.Call_Assoc_Fat (Mode);
else
Param_Var := Assoc_Info.Call_Assoc_Value (Mode);
diff --git a/src/vhdl/translate/trans.adb b/src/vhdl/translate/trans.adb
index 053d2335e..d41458d08 100644
--- a/src/vhdl/translate/trans.adb
+++ b/src/vhdl/translate/trans.adb
@@ -1229,7 +1229,7 @@ package body Trans is
return Mnode is
begin
if Is_Complex_Type (Info)
- and then Info.Type_Mode /= Type_Mode_Fat_Array
+ and then Info.Type_Mode not in Type_Mode_Unbounded
then
-- For a complex and constrained object, we just allocate
-- a pointer to the object.
diff --git a/src/vhdl/translate/trans.ads b/src/vhdl/translate/trans.ads
index 412c37c8e..b1549a0cb 100644
--- a/src/vhdl/translate/trans.ads
+++ b/src/vhdl/translate/trans.ads
@@ -1091,16 +1091,16 @@ package Trans is
-- Variable containing the size of the type.
-- This is defined only for types whose size is only known at
-- running time (and not a compile-time).
- Size_Var : Var_Type;
+ Size_Var : Var_Type := Null_Var;
- Builder_Need_Func : Boolean;
+ Builder_Need_Func : Boolean := False;
-- Parameters for type builders.
-- NOTE: this is only set for types (and *not* for subtypes).
Builder_Instance : Subprgs.Subprg_Instance_Type;
Builder_Base_Param : O_Dnode;
Builder_Bound_Param : O_Dnode;
- Builder_Func : O_Dnode;
+ Builder_Func : O_Dnode := O_Dnode_Null;
end record;
type Complex_Type_Arr_Info is array (Object_Kind_Type) of Complex_Type_Info;
type Complex_Type_Info_Acc is access Complex_Type_Arr_Info;