diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-10-05 03:30:32 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-10-05 03:58:24 +0200 |
commit | 937c3e565b1f249bf86805c8cb6d8ff93fa8d4b8 (patch) | |
tree | 6ae41efb2838e0c4d8054317aa7fc6d97ae177b4 | |
parent | 05bdcc96e259b338328812f4b3c4fb68f3c13f3c (diff) | |
download | ghdl-937c3e565b1f249bf86805c8cb6d8ff93fa8d4b8.tar.gz ghdl-937c3e565b1f249bf86805c8cb6d8ff93fa8d4b8.tar.bz2 ghdl-937c3e565b1f249bf86805c8cb6d8ff93fa8d4b8.zip |
iirs: subtype indication is never a ref.
-rw-r--r-- | src/vhdl/disp_vhdl.adb | 5 | ||||
-rw-r--r-- | src/vhdl/iirs.ads | 26 | ||||
-rw-r--r-- | src/vhdl/nodes_meta.adb | 420 | ||||
-rw-r--r-- | src/vhdl/parse.adb | 1 | ||||
-rw-r--r-- | src/vhdl/sem_decls.adb | 4 | ||||
-rw-r--r-- | src/vhdl/sem_expr.adb | 3 |
6 files changed, 216 insertions, 243 deletions
diff --git a/src/vhdl/disp_vhdl.adb b/src/vhdl/disp_vhdl.adb index 646630602..ec26bb84f 100644 --- a/src/vhdl/disp_vhdl.adb +++ b/src/vhdl/disp_vhdl.adb @@ -1070,6 +1070,7 @@ package body Disp_Vhdl is is Inter: Iir; Next_Inter : Iir; + First_Inter : Iir; Start: Count; begin if Chain = Null_Iir then @@ -1082,6 +1083,8 @@ package body Disp_Vhdl is Next_Inter := Get_Chain (Inter); Set_Col (Start); + First_Inter := Inter; + case Get_Kind (Inter) is when Iir_Kinds_Interface_Object_Declaration => Disp_Interface_Class (Inter); @@ -1092,7 +1095,7 @@ package body Disp_Vhdl is Next_Inter := Get_Chain (Inter); Disp_Name_Of (Inter); end loop; - Disp_Interface_Mode_And_Type (Inter); + Disp_Interface_Mode_And_Type (First_Inter); when Iir_Kind_Interface_Package_Declaration => Put ("package "); Disp_Identifier (Inter); diff --git a/src/vhdl/iirs.ads b/src/vhdl/iirs.ads index 6c3ed2bf8..a521fda52 100644 --- a/src/vhdl/iirs.ads +++ b/src/vhdl/iirs.ads @@ -1041,8 +1041,6 @@ package Iirs is -- Get/Set_After_Drivers_Flag (Flag5) -- -- Get/Set_Use_Flag (Flag6) - -- - -- Get/Set_Is_Ref (Flag7) -- Iir_Kind_Non_Object_Alias_Declaration (Short) -- @@ -1146,8 +1144,6 @@ package Iirs is -- Get/Set_Visible_Flag (Flag4) -- -- Get/Set_Use_Flag (Flag6) - -- - -- Get/Set_Is_Ref (Flag7) -- Iir_Kind_Nature_Declaration (Short) -- @@ -1604,6 +1600,7 @@ package Iirs is -- -- Get/Set_Use_Flag (Flag6) -- + -- Only for Iir_Kind_Constant_Declaration: -- Get/Set_Is_Ref (Flag7) -- -- Get/Set_Expr_Staticness (State1) @@ -1680,8 +1677,6 @@ package Iirs is -- -- Get/Set_Use_Flag (Flag6) -- - -- Get/Set_Is_Ref (Flag7) - -- -- Get/Set_Has_Mode (Flag10) -- -- Get/Set_Expr_Staticness (State1) @@ -1714,8 +1709,6 @@ package Iirs is -- Get/Set_Has_Identifier_List (Flag3) -- -- Get/Set_Visible_Flag (Flag4) - -- - -- Get/Set_Is_Ref (Flag7) -- Iir_Kind_Record_Element_Constraint (Short) -- @@ -3443,7 +3436,8 @@ package Iirs is -- Get/Set_Allocator_Designated_Type (Field2) -- -- Only for Iir_Kind_Allocator_By_Subtype: - -- Same as subtype indication but set to own the subtype. + -- Same as subtype indication but set when the allocator defines a new + -- subtype. -- Get/Set_Allocator_Subtype (Field3) -- -- Only for Iir_Kind_Allocator_By_Expression: @@ -3455,9 +3449,6 @@ package Iirs is -- Get/Set_Subtype_Indication (Field5) -- -- Get/Set_Expr_Staticness (State1) - -- - -- Only for Iir_Kind_Allocator_By_Subtype: - -- Get/Set_Is_Ref (Flag7) ------------ -- Names -- @@ -3629,8 +3620,6 @@ package Iirs is -- Only for Iir_Kind_External_Variable_Name: -- Get/Set_Shared_Flag (Flag2) -- - -- Get/Set_Is_Ref (Flag7) - -- -- Get/Set_Expr_Staticness (State1) -- -- Get/Set_Name_Staticness (State2) @@ -5705,7 +5694,7 @@ package Iirs is function Get_Literal_Subtype (Lit : Iir) return Iir; procedure Set_Literal_Subtype (Lit : Iir; Atype : Iir); - -- Field: Field3 + -- Field: Field3 Ref function Get_Allocator_Subtype (Lit : Iir) return Iir; procedure Set_Allocator_Subtype (Lit : Iir; Atype : Iir); @@ -5927,10 +5916,11 @@ package Iirs is procedure Set_Type (Target : Iir; Atype : Iir); pragma Inline (Get_Type); - -- The subtype indication of a declaration. Note that this node can be - -- shared between declarations if they are separated by comma, such as in: + -- The subtype indication of a declaration. If several declarations share + -- the same subtype_indication like in: -- variable a, b : integer := 5; - -- Field: Field5 Maybe_Ref + -- then only the first declaration has a subtype_indication. + -- Field: Field5 function Get_Subtype_Indication (Target : Iir) return Iir; procedure Set_Subtype_Indication (Target : Iir; Atype : Iir); diff --git a/src/vhdl/nodes_meta.adb b/src/vhdl/nodes_meta.adb index b94f57dcc..63bae62b4 100644 --- a/src/vhdl/nodes_meta.adb +++ b/src/vhdl/nodes_meta.adb @@ -1587,7 +1587,7 @@ package body Nodes_Meta is when Field_Literal_Subtype => return Attr_None; when Field_Allocator_Subtype => - return Attr_None; + return Attr_Ref; when Field_Entity_Class => return Attr_None; when Field_Entity_Name_List => @@ -1679,7 +1679,7 @@ package body Nodes_Meta is when Field_Type => return Attr_Ref; when Field_Subtype_Indication => - return Attr_Maybe_Ref; + return Attr_None; when Field_Discrete_Range => return Attr_Ref; when Field_Type_Definition => @@ -2665,7 +2665,6 @@ package body Nodes_Meta is Field_Identifier, Field_Visible_Flag, Field_Use_Flag, - Field_Is_Ref, Field_Chain, Field_Subtype_Indication, Field_Parent, @@ -2825,7 +2824,6 @@ package body Nodes_Meta is Field_Element_Position, Field_Has_Identifier_List, Field_Visible_Flag, - Field_Is_Ref, Field_Subtype_Indication, Field_Type, -- Iir_Kind_Non_Object_Alias_Declaration @@ -2993,7 +2991,6 @@ package body Nodes_Meta is Field_Visible_Flag, Field_After_Drivers_Flag, Field_Use_Flag, - Field_Is_Ref, Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, @@ -3007,14 +3004,13 @@ package body Nodes_Meta is Field_Has_Identifier_List, Field_Visible_Flag, Field_Use_Flag, - Field_Is_Ref, Field_Mode, Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, + Field_Subtype_Indication, Field_File_Logical_Name, Field_File_Open_Kind, - Field_Subtype_Indication, Field_Parent, Field_Type, -- Iir_Kind_Guard_Signal_Declaration @@ -3045,8 +3041,8 @@ package body Nodes_Meta is Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, - Field_Default_Value, Field_Subtype_Indication, + Field_Default_Value, Field_Parent, Field_Type, -- Iir_Kind_Variable_Declaration @@ -3059,8 +3055,8 @@ package body Nodes_Meta is Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, - Field_Default_Value, Field_Subtype_Indication, + Field_Default_Value, Field_Parent, Field_Type, -- Iir_Kind_Constant_Declaration @@ -3073,8 +3069,8 @@ package body Nodes_Meta is Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, - Field_Default_Value, Field_Subtype_Indication, + Field_Default_Value, Field_Parent, Field_Type, Field_Deferred_Declaration, @@ -3083,7 +3079,6 @@ package body Nodes_Meta is Field_Has_Identifier_List, Field_Visible_Flag, Field_Use_Flag, - Field_Is_Ref, Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, @@ -3104,8 +3099,8 @@ package body Nodes_Meta is Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, - Field_Default_Value, Field_Subtype_Indication, + Field_Default_Value, Field_Parent, Field_Type, -- Iir_Kind_Interface_Variable_Declaration @@ -3121,8 +3116,8 @@ package body Nodes_Meta is Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, - Field_Default_Value, Field_Subtype_Indication, + Field_Default_Value, Field_Parent, Field_Type, -- Iir_Kind_Interface_Signal_Declaration @@ -3143,8 +3138,8 @@ package body Nodes_Meta is Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, - Field_Default_Value, Field_Subtype_Indication, + Field_Default_Value, Field_Parent, Field_Type, -- Iir_Kind_Interface_File_Declaration @@ -3160,8 +3155,8 @@ package body Nodes_Meta is Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, - Field_Default_Value, Field_Subtype_Indication, + Field_Default_Value, Field_Parent, Field_Type, -- Iir_Kind_Interface_Type_Declaration @@ -3500,12 +3495,11 @@ package body Nodes_Meta is Field_Type, Field_Allocator_Designated_Type, -- Iir_Kind_Allocator_By_Subtype - Field_Is_Ref, Field_Expr_Staticness, - Field_Allocator_Subtype, Field_Subtype_Indication, Field_Type, Field_Allocator_Designated_Type, + Field_Allocator_Subtype, -- Iir_Kind_Selected_Element Field_Expr_Staticness, Field_Name_Staticness, @@ -3932,7 +3926,6 @@ package body Nodes_Meta is Field_Named_Entity, -- Iir_Kind_External_Constant_Name Field_Shared_Flag, - Field_Is_Ref, Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, @@ -3942,7 +3935,6 @@ package body Nodes_Meta is Field_Type, -- Iir_Kind_External_Signal_Name Field_Shared_Flag, - Field_Is_Ref, Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, @@ -3952,7 +3944,6 @@ package body Nodes_Meta is Field_Type, -- Iir_Kind_External_Variable_Name Field_Shared_Flag, - Field_Is_Ref, Field_Expr_Staticness, Field_Name_Staticness, Field_Chain, @@ -4306,194 +4297,194 @@ package body Nodes_Meta is Iir_Kind_Overload_List => 428, Iir_Kind_Type_Declaration => 435, Iir_Kind_Anonymous_Type_Declaration => 441, - Iir_Kind_Subtype_Declaration => 449, - Iir_Kind_Nature_Declaration => 455, - Iir_Kind_Subnature_Declaration => 461, - Iir_Kind_Package_Declaration => 476, - Iir_Kind_Package_Instantiation_Declaration => 488, - Iir_Kind_Package_Body => 496, - Iir_Kind_Configuration_Declaration => 505, - Iir_Kind_Entity_Declaration => 517, - Iir_Kind_Architecture_Body => 529, - Iir_Kind_Context_Declaration => 535, - Iir_Kind_Package_Header => 537, - Iir_Kind_Unit_Declaration => 546, - Iir_Kind_Library_Declaration => 553, - Iir_Kind_Component_Declaration => 563, - Iir_Kind_Attribute_Declaration => 570, - Iir_Kind_Group_Template_Declaration => 576, - Iir_Kind_Group_Declaration => 583, - Iir_Kind_Element_Declaration => 590, - Iir_Kind_Non_Object_Alias_Declaration => 598, - Iir_Kind_Psl_Declaration => 606, - Iir_Kind_Psl_Endpoint_Declaration => 620, - Iir_Kind_Terminal_Declaration => 626, - Iir_Kind_Free_Quantity_Declaration => 635, - Iir_Kind_Across_Quantity_Declaration => 647, - Iir_Kind_Through_Quantity_Declaration => 659, - Iir_Kind_Enumeration_Literal => 670, - Iir_Kind_Function_Declaration => 694, - Iir_Kind_Procedure_Declaration => 717, - Iir_Kind_Function_Body => 727, - Iir_Kind_Procedure_Body => 738, - Iir_Kind_Object_Alias_Declaration => 750, - Iir_Kind_File_Declaration => 765, - Iir_Kind_Guard_Signal_Declaration => 778, - Iir_Kind_Signal_Declaration => 795, - Iir_Kind_Variable_Declaration => 808, - Iir_Kind_Constant_Declaration => 822, - Iir_Kind_Iterator_Declaration => 834, - Iir_Kind_Interface_Constant_Declaration => 850, - Iir_Kind_Interface_Variable_Declaration => 866, - Iir_Kind_Interface_Signal_Declaration => 887, - Iir_Kind_Interface_File_Declaration => 903, - Iir_Kind_Interface_Type_Declaration => 913, - Iir_Kind_Interface_Package_Declaration => 923, - Iir_Kind_Interface_Function_Declaration => 939, - Iir_Kind_Interface_Procedure_Declaration => 951, - Iir_Kind_Identity_Operator => 955, - Iir_Kind_Negation_Operator => 959, - Iir_Kind_Absolute_Operator => 963, - Iir_Kind_Not_Operator => 967, - Iir_Kind_Condition_Operator => 971, - Iir_Kind_Reduction_And_Operator => 975, - Iir_Kind_Reduction_Or_Operator => 979, - Iir_Kind_Reduction_Nand_Operator => 983, - Iir_Kind_Reduction_Nor_Operator => 987, - Iir_Kind_Reduction_Xor_Operator => 991, - Iir_Kind_Reduction_Xnor_Operator => 995, - Iir_Kind_And_Operator => 1000, - Iir_Kind_Or_Operator => 1005, - Iir_Kind_Nand_Operator => 1010, - Iir_Kind_Nor_Operator => 1015, - Iir_Kind_Xor_Operator => 1020, - Iir_Kind_Xnor_Operator => 1025, - Iir_Kind_Equality_Operator => 1030, - Iir_Kind_Inequality_Operator => 1035, - Iir_Kind_Less_Than_Operator => 1040, - Iir_Kind_Less_Than_Or_Equal_Operator => 1045, - Iir_Kind_Greater_Than_Operator => 1050, - Iir_Kind_Greater_Than_Or_Equal_Operator => 1055, - Iir_Kind_Match_Equality_Operator => 1060, - Iir_Kind_Match_Inequality_Operator => 1065, - Iir_Kind_Match_Less_Than_Operator => 1070, - Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1075, - Iir_Kind_Match_Greater_Than_Operator => 1080, - Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1085, - Iir_Kind_Sll_Operator => 1090, - Iir_Kind_Sla_Operator => 1095, - Iir_Kind_Srl_Operator => 1100, - Iir_Kind_Sra_Operator => 1105, - Iir_Kind_Rol_Operator => 1110, - Iir_Kind_Ror_Operator => 1115, - Iir_Kind_Addition_Operator => 1120, - Iir_Kind_Substraction_Operator => 1125, - Iir_Kind_Concatenation_Operator => 1130, - Iir_Kind_Multiplication_Operator => 1135, - Iir_Kind_Division_Operator => 1140, - Iir_Kind_Modulus_Operator => 1145, - Iir_Kind_Remainder_Operator => 1150, - Iir_Kind_Exponentiation_Operator => 1155, - Iir_Kind_Function_Call => 1163, - Iir_Kind_Aggregate => 1169, - Iir_Kind_Parenthesis_Expression => 1172, - Iir_Kind_Qualified_Expression => 1176, - Iir_Kind_Type_Conversion => 1181, - Iir_Kind_Allocator_By_Expression => 1185, - Iir_Kind_Allocator_By_Subtype => 1191, - Iir_Kind_Selected_Element => 1197, - Iir_Kind_Dereference => 1202, - Iir_Kind_Implicit_Dereference => 1207, - Iir_Kind_Slice_Name => 1214, - Iir_Kind_Indexed_Name => 1220, - Iir_Kind_Psl_Expression => 1222, - Iir_Kind_Sensitized_Process_Statement => 1242, - Iir_Kind_Process_Statement => 1262, - Iir_Kind_Concurrent_Simple_Signal_Assignment => 1273, - Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1284, - Iir_Kind_Concurrent_Selected_Signal_Assignment => 1296, - Iir_Kind_Concurrent_Assertion_Statement => 1304, - Iir_Kind_Concurrent_Procedure_Call_Statement => 1311, - Iir_Kind_Psl_Assert_Statement => 1324, - Iir_Kind_Psl_Cover_Statement => 1337, - Iir_Kind_Block_Statement => 1350, - Iir_Kind_If_Generate_Statement => 1360, - Iir_Kind_Case_Generate_Statement => 1369, - Iir_Kind_For_Generate_Statement => 1378, - Iir_Kind_Component_Instantiation_Statement => 1388, - Iir_Kind_Psl_Default_Clock => 1392, - Iir_Kind_Simple_Simultaneous_Statement => 1399, - Iir_Kind_Generate_Statement_Body => 1410, - Iir_Kind_If_Generate_Else_Clause => 1415, - Iir_Kind_Simple_Signal_Assignment_Statement => 1424, - Iir_Kind_Conditional_Signal_Assignment_Statement => 1433, - Iir_Kind_Null_Statement => 1437, - Iir_Kind_Assertion_Statement => 1444, - Iir_Kind_Report_Statement => 1450, - Iir_Kind_Wait_Statement => 1457, - Iir_Kind_Variable_Assignment_Statement => 1463, - Iir_Kind_Conditional_Variable_Assignment_Statement => 1469, - Iir_Kind_Return_Statement => 1475, - Iir_Kind_For_Loop_Statement => 1484, - Iir_Kind_While_Loop_Statement => 1492, - Iir_Kind_Next_Statement => 1498, - Iir_Kind_Exit_Statement => 1504, - Iir_Kind_Case_Statement => 1512, - Iir_Kind_Procedure_Call_Statement => 1518, - Iir_Kind_If_Statement => 1527, - Iir_Kind_Elsif => 1532, - Iir_Kind_Character_Literal => 1539, - Iir_Kind_Simple_Name => 1546, - Iir_Kind_Selected_Name => 1554, - Iir_Kind_Operator_Symbol => 1559, - Iir_Kind_Selected_By_All_Name => 1564, - Iir_Kind_Parenthesis_Name => 1568, - Iir_Kind_External_Constant_Name => 1577, - Iir_Kind_External_Signal_Name => 1586, - Iir_Kind_External_Variable_Name => 1595, - Iir_Kind_Package_Pathname => 1598, - Iir_Kind_Absolute_Pathname => 1599, - Iir_Kind_Relative_Pathname => 1600, - Iir_Kind_Pathname_Element => 1604, - Iir_Kind_Base_Attribute => 1606, - Iir_Kind_Left_Type_Attribute => 1611, - Iir_Kind_Right_Type_Attribute => 1616, - Iir_Kind_High_Type_Attribute => 1621, - Iir_Kind_Low_Type_Attribute => 1626, - Iir_Kind_Ascending_Type_Attribute => 1631, - Iir_Kind_Image_Attribute => 1637, - Iir_Kind_Value_Attribute => 1643, - Iir_Kind_Pos_Attribute => 1649, - Iir_Kind_Val_Attribute => 1655, - Iir_Kind_Succ_Attribute => 1661, - Iir_Kind_Pred_Attribute => 1667, - Iir_Kind_Leftof_Attribute => 1673, - Iir_Kind_Rightof_Attribute => 1679, - Iir_Kind_Delayed_Attribute => 1687, - Iir_Kind_Stable_Attribute => 1695, - Iir_Kind_Quiet_Attribute => 1703, - Iir_Kind_Transaction_Attribute => 1711, - Iir_Kind_Event_Attribute => 1715, - Iir_Kind_Active_Attribute => 1719, - Iir_Kind_Last_Event_Attribute => 1723, - Iir_Kind_Last_Active_Attribute => 1727, - Iir_Kind_Last_Value_Attribute => 1731, - Iir_Kind_Driving_Attribute => 1735, - Iir_Kind_Driving_Value_Attribute => 1739, - Iir_Kind_Behavior_Attribute => 1739, - Iir_Kind_Structure_Attribute => 1739, - Iir_Kind_Simple_Name_Attribute => 1746, - Iir_Kind_Instance_Name_Attribute => 1751, - Iir_Kind_Path_Name_Attribute => 1756, - Iir_Kind_Left_Array_Attribute => 1763, - Iir_Kind_Right_Array_Attribute => 1770, - Iir_Kind_High_Array_Attribute => 1777, - Iir_Kind_Low_Array_Attribute => 1784, - Iir_Kind_Length_Array_Attribute => 1791, - Iir_Kind_Ascending_Array_Attribute => 1798, - Iir_Kind_Range_Array_Attribute => 1805, - Iir_Kind_Reverse_Range_Array_Attribute => 1812, - Iir_Kind_Attribute_Name => 1820 + Iir_Kind_Subtype_Declaration => 448, + Iir_Kind_Nature_Declaration => 454, + Iir_Kind_Subnature_Declaration => 460, + Iir_Kind_Package_Declaration => 475, + Iir_Kind_Package_Instantiation_Declaration => 487, + Iir_Kind_Package_Body => 495, + Iir_Kind_Configuration_Declaration => 504, + Iir_Kind_Entity_Declaration => 516, + Iir_Kind_Architecture_Body => 528, + Iir_Kind_Context_Declaration => 534, + Iir_Kind_Package_Header => 536, + Iir_Kind_Unit_Declaration => 545, + Iir_Kind_Library_Declaration => 552, + Iir_Kind_Component_Declaration => 562, + Iir_Kind_Attribute_Declaration => 569, + Iir_Kind_Group_Template_Declaration => 575, + Iir_Kind_Group_Declaration => 582, + Iir_Kind_Element_Declaration => 588, + Iir_Kind_Non_Object_Alias_Declaration => 596, + Iir_Kind_Psl_Declaration => 604, + Iir_Kind_Psl_Endpoint_Declaration => 618, + Iir_Kind_Terminal_Declaration => 624, + Iir_Kind_Free_Quantity_Declaration => 633, + Iir_Kind_Across_Quantity_Declaration => 645, + Iir_Kind_Through_Quantity_Declaration => 657, + Iir_Kind_Enumeration_Literal => 668, + Iir_Kind_Function_Declaration => 692, + Iir_Kind_Procedure_Declaration => 715, + Iir_Kind_Function_Body => 725, + Iir_Kind_Procedure_Body => 736, + Iir_Kind_Object_Alias_Declaration => 747, + Iir_Kind_File_Declaration => 761, + Iir_Kind_Guard_Signal_Declaration => 774, + Iir_Kind_Signal_Declaration => 791, + Iir_Kind_Variable_Declaration => 804, + Iir_Kind_Constant_Declaration => 818, + Iir_Kind_Iterator_Declaration => 829, + Iir_Kind_Interface_Constant_Declaration => 845, + Iir_Kind_Interface_Variable_Declaration => 861, + Iir_Kind_Interface_Signal_Declaration => 882, + Iir_Kind_Interface_File_Declaration => 898, + Iir_Kind_Interface_Type_Declaration => 908, + Iir_Kind_Interface_Package_Declaration => 918, + Iir_Kind_Interface_Function_Declaration => 934, + Iir_Kind_Interface_Procedure_Declaration => 946, + Iir_Kind_Identity_Operator => 950, + Iir_Kind_Negation_Operator => 954, + Iir_Kind_Absolute_Operator => 958, + Iir_Kind_Not_Operator => 962, + Iir_Kind_Condition_Operator => 966, + Iir_Kind_Reduction_And_Operator => 970, + Iir_Kind_Reduction_Or_Operator => 974, + Iir_Kind_Reduction_Nand_Operator => 978, + Iir_Kind_Reduction_Nor_Operator => 982, + Iir_Kind_Reduction_Xor_Operator => 986, + Iir_Kind_Reduction_Xnor_Operator => 990, + Iir_Kind_And_Operator => 995, + Iir_Kind_Or_Operator => 1000, + Iir_Kind_Nand_Operator => 1005, + Iir_Kind_Nor_Operator => 1010, + Iir_Kind_Xor_Operator => 1015, + Iir_Kind_Xnor_Operator => 1020, + Iir_Kind_Equality_Operator => 1025, + Iir_Kind_Inequality_Operator => 1030, + Iir_Kind_Less_Than_Operator => 1035, + Iir_Kind_Less_Than_Or_Equal_Operator => 1040, + Iir_Kind_Greater_Than_Operator => 1045, + Iir_Kind_Greater_Than_Or_Equal_Operator => 1050, + Iir_Kind_Match_Equality_Operator => 1055, + Iir_Kind_Match_Inequality_Operator => 1060, + Iir_Kind_Match_Less_Than_Operator => 1065, + Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1070, + Iir_Kind_Match_Greater_Than_Operator => 1075, + Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1080, + Iir_Kind_Sll_Operator => 1085, + Iir_Kind_Sla_Operator => 1090, + Iir_Kind_Srl_Operator => 1095, + Iir_Kind_Sra_Operator => 1100, + Iir_Kind_Rol_Operator => 1105, + Iir_Kind_Ror_Operator => 1110, + Iir_Kind_Addition_Operator => 1115, + Iir_Kind_Substraction_Operator => 1120, + Iir_Kind_Concatenation_Operator => 1125, + Iir_Kind_Multiplication_Operator => 1130, + Iir_Kind_Division_Operator => 1135, + Iir_Kind_Modulus_Operator => 1140, + Iir_Kind_Remainder_Operator => 1145, + Iir_Kind_Exponentiation_Operator => 1150, + Iir_Kind_Function_Call => 1158, + Iir_Kind_Aggregate => 1164, + Iir_Kind_Parenthesis_Expression => 1167, + Iir_Kind_Qualified_Expression => 1171, + Iir_Kind_Type_Conversion => 1176, + Iir_Kind_Allocator_By_Expression => 1180, + Iir_Kind_Allocator_By_Subtype => 1185, + Iir_Kind_Selected_Element => 1191, + Iir_Kind_Dereference => 1196, + Iir_Kind_Implicit_Dereference => 1201, + Iir_Kind_Slice_Name => 1208, + Iir_Kind_Indexed_Name => 1214, + Iir_Kind_Psl_Expression => 1216, + Iir_Kind_Sensitized_Process_Statement => 1236, + Iir_Kind_Process_Statement => 1256, + Iir_Kind_Concurrent_Simple_Signal_Assignment => 1267, + Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1278, + Iir_Kind_Concurrent_Selected_Signal_Assignment => 1290, + Iir_Kind_Concurrent_Assertion_Statement => 1298, + Iir_Kind_Concurrent_Procedure_Call_Statement => 1305, + Iir_Kind_Psl_Assert_Statement => 1318, + Iir_Kind_Psl_Cover_Statement => 1331, + Iir_Kind_Block_Statement => 1344, + Iir_Kind_If_Generate_Statement => 1354, + Iir_Kind_Case_Generate_Statement => 1363, + Iir_Kind_For_Generate_Statement => 1372, + Iir_Kind_Component_Instantiation_Statement => 1382, + Iir_Kind_Psl_Default_Clock => 1386, + Iir_Kind_Simple_Simultaneous_Statement => 1393, + Iir_Kind_Generate_Statement_Body => 1404, + Iir_Kind_If_Generate_Else_Clause => 1409, + Iir_Kind_Simple_Signal_Assignment_Statement => 1418, + Iir_Kind_Conditional_Signal_Assignment_Statement => 1427, + Iir_Kind_Null_Statement => 1431, + Iir_Kind_Assertion_Statement => 1438, + Iir_Kind_Report_Statement => 1444, + Iir_Kind_Wait_Statement => 1451, + Iir_Kind_Variable_Assignment_Statement => 1457, + Iir_Kind_Conditional_Variable_Assignment_Statement => 1463, + Iir_Kind_Return_Statement => 1469, + Iir_Kind_For_Loop_Statement => 1478, + Iir_Kind_While_Loop_Statement => 1486, + Iir_Kind_Next_Statement => 1492, + Iir_Kind_Exit_Statement => 1498, + Iir_Kind_Case_Statement => 1506, + Iir_Kind_Procedure_Call_Statement => 1512, + Iir_Kind_If_Statement => 1521, + Iir_Kind_Elsif => 1526, + Iir_Kind_Character_Literal => 1533, + Iir_Kind_Simple_Name => 1540, + Iir_Kind_Selected_Name => 1548, + Iir_Kind_Operator_Symbol => 1553, + Iir_Kind_Selected_By_All_Name => 1558, + Iir_Kind_Parenthesis_Name => 1562, + Iir_Kind_External_Constant_Name => 1570, + Iir_Kind_External_Signal_Name => 1578, + Iir_Kind_External_Variable_Name => 1586, + Iir_Kind_Package_Pathname => 1589, + Iir_Kind_Absolute_Pathname => 1590, + Iir_Kind_Relative_Pathname => 1591, + Iir_Kind_Pathname_Element => 1595, + Iir_Kind_Base_Attribute => 1597, + Iir_Kind_Left_Type_Attribute => 1602, + Iir_Kind_Right_Type_Attribute => 1607, + Iir_Kind_High_Type_Attribute => 1612, + Iir_Kind_Low_Type_Attribute => 1617, + Iir_Kind_Ascending_Type_Attribute => 1622, + Iir_Kind_Image_Attribute => 1628, + Iir_Kind_Value_Attribute => 1634, + Iir_Kind_Pos_Attribute => 1640, + Iir_Kind_Val_Attribute => 1646, + Iir_Kind_Succ_Attribute => 1652, + Iir_Kind_Pred_Attribute => 1658, + Iir_Kind_Leftof_Attribute => 1664, + Iir_Kind_Rightof_Attribute => 1670, + Iir_Kind_Delayed_Attribute => 1678, + Iir_Kind_Stable_Attribute => 1686, + Iir_Kind_Quiet_Attribute => 1694, + Iir_Kind_Transaction_Attribute => 1702, + Iir_Kind_Event_Attribute => 1706, + Iir_Kind_Active_Attribute => 1710, + Iir_Kind_Last_Event_Attribute => 1714, + Iir_Kind_Last_Active_Attribute => 1718, + Iir_Kind_Last_Value_Attribute => 1722, + Iir_Kind_Driving_Attribute => 1726, + Iir_Kind_Driving_Value_Attribute => 1730, + Iir_Kind_Behavior_Attribute => 1730, + Iir_Kind_Structure_Attribute => 1730, + Iir_Kind_Simple_Name_Attribute => 1737, + Iir_Kind_Instance_Name_Attribute => 1742, + Iir_Kind_Path_Name_Attribute => 1747, + Iir_Kind_Left_Array_Attribute => 1754, + Iir_Kind_Right_Array_Attribute => 1761, + Iir_Kind_High_Array_Attribute => 1768, + Iir_Kind_Low_Array_Attribute => 1775, + Iir_Kind_Length_Array_Attribute => 1782, + Iir_Kind_Ascending_Array_Attribute => 1789, + Iir_Kind_Range_Array_Attribute => 1796, + Iir_Kind_Reverse_Range_Array_Attribute => 1803, + Iir_Kind_Attribute_Name => 1811 ); function Get_Fields (K : Iir_Kind) return Fields_Array @@ -10174,23 +10165,14 @@ package body Nodes_Meta is function Has_Is_Ref (K : Iir_Kind) return Boolean is begin case K is - when Iir_Kind_Subtype_Declaration - | Iir_Kind_Element_Declaration - | Iir_Kind_Object_Alias_Declaration - | Iir_Kind_File_Declaration - | Iir_Kind_Signal_Declaration + when Iir_Kind_Signal_Declaration | Iir_Kind_Variable_Declaration | Iir_Kind_Constant_Declaration - | Iir_Kind_Iterator_Declaration | Iir_Kind_Interface_Constant_Declaration | Iir_Kind_Interface_Variable_Declaration | Iir_Kind_Interface_Signal_Declaration | Iir_Kind_Interface_File_Declaration - | Iir_Kind_Interface_Type_Declaration - | Iir_Kind_Allocator_By_Subtype - | Iir_Kind_External_Constant_Name - | Iir_Kind_External_Signal_Name - | Iir_Kind_External_Variable_Name => + | Iir_Kind_Interface_Type_Declaration => return True; when others => return False; diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index 1bcb66e78..7dfb2c7bf 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -3369,7 +3369,6 @@ package body Parse is when others => null; end case; - Set_Is_Ref (Object, Object /= First); Object := Get_Chain (Object); end loop; diff --git a/src/vhdl/sem_decls.adb b/src/vhdl/sem_decls.adb index 7d83c2e13..517d69c6c 100644 --- a/src/vhdl/sem_decls.adb +++ b/src/vhdl/sem_decls.adb @@ -128,7 +128,6 @@ package body Sem_Decls is A_Type := Get_Subtype_Indication (Inter); if A_Type = Null_Iir then pragma Assert (Last /= Null_Iir); - Set_Subtype_Indication (Inter, Get_Subtype_Indication (Last)); A_Type := Get_Type (Last); Default_Value := Get_Default_Value (Last); else @@ -1741,6 +1740,9 @@ package body Sem_Decls is end if; else Default_Value := Get_Default_Value (Last_Decl); + if Is_Valid (Default_Value) then + Set_Is_Ref (Decl, True); + end if; Atype := Get_Type (Last_Decl); end if; diff --git a/src/vhdl/sem_expr.adb b/src/vhdl/sem_expr.adb index 925c06826..0e13a1936 100644 --- a/src/vhdl/sem_expr.adb +++ b/src/vhdl/sem_expr.adb @@ -3705,9 +3705,6 @@ package body Sem_Expr is end if; if Is_Anonymous_Type_Definition (Arg) then Set_Allocator_Subtype (Expr, Get_Subtype_Indication (Expr)); - Set_Is_Ref (Expr, True); - else - Set_Is_Ref (Expr, False); end if; -- LRM93 7.3.6 |