diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-09-24 04:20:03 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-09-25 18:32:45 +0200 |
commit | 85387f99d7f8d0341229d58b249f9137db34c185 (patch) | |
tree | cb0f45c60c3280e719669a436401f5c1c4b9989b /src | |
parent | 7510e8a3d9a6b00b634addf41ea07a5e0b1f9cb0 (diff) | |
download | ghdl-85387f99d7f8d0341229d58b249f9137db34c185.tar.gz ghdl-85387f99d7f8d0341229d58b249f9137db34c185.tar.bz2 ghdl-85387f99d7f8d0341229d58b249f9137db34c185.zip |
sem_assocs: remove unused subprograms.
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/sem_assocs.adb | 134 |
1 files changed, 0 insertions, 134 deletions
diff --git a/src/vhdl/sem_assocs.adb b/src/vhdl/sem_assocs.adb index 1b0910469..702d10c5c 100644 --- a/src/vhdl/sem_assocs.adb +++ b/src/vhdl/sem_assocs.adb @@ -1198,129 +1198,6 @@ package body Sem_Assocs is return True; end Is_Conversion_Function; - function Is_Expanded_Name (Name : Iir) return Boolean - is - Pfx : Iir; - begin - Pfx := Name; - loop - case Get_Kind (Pfx) is - when Iir_Kind_Simple_Name => - return True; - when Iir_Kind_Selected_Name => - Pfx := Get_Prefix (Pfx); - when others => - return False; - end case; - end loop; - end Is_Expanded_Name; - - function Extract_Type_Of_Conversions (Convs : Iir) return Iir - is - -- Return TRUE iff FUNC is valid as a conversion function/type. - function Extract_Type_Of_Conversion (Func : Iir) return Iir is - begin - case Get_Kind (Func) is - when Iir_Kind_Function_Declaration => - if Is_Chain_Length_One (Get_Interface_Declaration_Chain (Func)) - then - return Get_Type (Func); - else - return Null_Iir; - end if; - when Iir_Kind_Type_Declaration - | Iir_Kind_Subtype_Declaration => - if Flags.Vhdl_Std = Vhdl_87 then - return Null_Iir; - end if; - return Get_Type (Func); - when others => - return Null_Iir; - end case; - end Extract_Type_Of_Conversion; - - Res_List : Iir_List; - Ov_List : Iir_List; - El : Iir; - Conv_Type : Iir; - begin - if not Is_Overload_List (Convs) then - return Extract_Type_Of_Conversion (Convs); - else - Ov_List := Get_Overload_List (Convs); - Res_List := Create_Iir_List; - for I in Natural loop - El := Get_Nth_Element (Ov_List, I); - exit when El = Null_Iir; - Conv_Type := Extract_Type_Of_Conversion (El); - if Conv_Type /= Null_Iir then - Add_Element (Res_List, Conv_Type); - end if; - end loop; - return Simplify_Overload_List (Res_List); - end if; - end Extract_Type_Of_Conversions; - - -- ASSOC is an association element not analyzed and whose formal is a - -- parenthesis name. Try to extract a conversion function/type. In case - -- of success, modify the association to represent the conversion and - -- returns the parenthesis_name node (to be freed or to revert the change). - -- In case of failure, return NULL_IIR. - function Sem_Formal_Conversion (Assoc : Iir) return Iir - is - Formal : constant Iir := Get_Formal (Assoc); - pragma Assert (Get_Kind (Formal) = Iir_Kind_Parenthesis_Name); - Assoc_Chain : constant Iir := Get_Association_Chain (Formal); - Conv : Iir; - Name : Iir; - Conv_Func : Iir; - Conv_Type : Iir; - begin - -- Nothing to do if the formal isn't a conversion. - if not Is_Conversion_Function (Assoc_Chain) then - return Null_Iir; - end if; - - -- Both the conversion function and the formal name must be names. - Conv := Get_Prefix (Formal); - -- FIXME: what about operator names (such as "not"). - if Get_Kind (Conv) /= Iir_Kind_Simple_Name - and then not Is_Expanded_Name (Conv) - then - return Null_Iir; - end if; - Name := Get_Actual (Assoc_Chain); - if Get_Kind (Name) not in Iir_Kinds_Name then - return Null_Iir; - end if; - - Sem_Name_Soft (Conv); - Conv_Func := Get_Named_Entity (Conv); - if Get_Kind (Conv_Func) = Iir_Kind_Error then - Conv_Type := Null_Iir; - else - Conv_Type := Extract_Type_Of_Conversions (Conv_Func); - end if; - if Conv_Type = Null_Iir then - Sem_Name_Clean (Conv); - return Null_Iir; - end if; - Set_Type (Conv, Conv_Type); - - Set_Formal_Conversion (Assoc, Conv); - Set_Formal (Assoc, Name); - - return Formal; - end Sem_Formal_Conversion; - - procedure Revert_Formal_Conversion (Assoc : Iir; Saved_Assoc : Iir) is - begin - Sem_Name_Clean (Get_Formal_Conversion (Assoc)); - Set_Formal_Conversion (Assoc, Null_Iir); - Sem_Name_Clean (Get_Formal (Assoc)); - Set_Formal (Assoc, Saved_Assoc); - end Revert_Formal_Conversion; - function Is_Valid_Conversion (Func : Iir; Res_Base_Type : Iir; Param_Base_Type : Iir) return Boolean is @@ -2095,17 +1972,6 @@ package body Sem_Assocs is end case; end Sem_Association; - procedure Revert_Sem_Association (Assoc : Iir) is - begin - pragma Assert - (Get_Kind (Assoc) = Iir_Kind_Association_Element_By_Expression); - Sem_Name_Clean (Get_Formal (Assoc)); - end Revert_Sem_Association; - - pragma Unreferenced (Sem_Formal_Conversion); - pragma Unreferenced (Revert_Formal_Conversion); - pragma Unreferenced (Revert_Sem_Association); - procedure Sem_Association_Chain (Interface_Chain : Iir; Assoc_Chain: in out Iir; |