diff options
author | Tristan Gingold | 2015-09-01 21:22:01 +0200 |
---|---|---|
committer | Tristan Gingold | 2015-09-01 21:22:01 +0200 |
commit | 133686da496f0592da76a45361e70ac8d6c482ea (patch) | |
tree | def19afa6316630a622bcb835c116e815f6e455a /src | |
parent | 50a40f8823aab990ba9dc17af1e91c47f7f1692a (diff) | |
download | ghdl-133686da496f0592da76a45361e70ac8d6c482ea.tar.gz ghdl-133686da496f0592da76a45361e70ac8d6c482ea.tar.bz2 ghdl-133686da496f0592da76a45361e70ac8d6c482ea.zip |
Destroy types of default generic values.
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/translate/trans-chap4.adb | 2 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap5.adb | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/vhdl/translate/trans-chap4.adb b/src/vhdl/translate/trans-chap4.adb index 852be4f..34521c0 100644 --- a/src/vhdl/translate/trans-chap4.adb +++ b/src/vhdl/translate/trans-chap4.adb @@ -1846,7 +1846,7 @@ package body Trans.Chap4 is New_Var_Decl (Var_Bound, Get_Identifier ("BOUND"), O_Storage_Local, Base_Info.T.Bounds_Type); - New_Var_Decl (Var_Array, Get_Identifier ("ARRAY"), O_Storage_Local, + New_Var_Decl (Var_Array, Get_Identifier ("VARRAY"), O_Storage_Local, Base_Info.Ortho_Type (Mode_Value)); Open_Temp; diff --git a/src/vhdl/translate/trans-chap5.adb b/src/vhdl/translate/trans-chap5.adb index f8cfadb..e6ac7e5 100644 --- a/src/vhdl/translate/trans-chap5.adb +++ b/src/vhdl/translate/trans-chap5.adb @@ -22,6 +22,7 @@ with Trans.Chap3; with Trans.Chap4; with Trans.Chap6; with Trans.Chap7; +with Trans.Chap9; with Trans_Decls; use Trans_Decls; with Trans.Helpers2; use Trans.Helpers2; with Trans.Foreach_Non_Composite; @@ -388,9 +389,8 @@ package body Trans.Chap5 is Data : Connect_Data; Mode : Connect_Mode; begin - if Get_Kind (Assoc) /= Iir_Kind_Association_Element_By_Expression then - raise Internal_Error; - end if; + pragma Assert + (Get_Kind (Assoc) = Iir_Kind_Association_Element_By_Expression); Open_Temp; if Get_In_Conversion (Assoc) = Null_Iir @@ -531,10 +531,7 @@ package body Trans.Chap5 is Assoc := Get_Generic_Map_Aspect_Chain (Mapping); while Assoc /= Null_Iir loop Open_Temp; - Formal := Get_Formal (Assoc); - if Get_Kind (Formal) in Iir_Kinds_Denoting_Name then - Formal := Get_Named_Entity (Formal); - end if; + Formal := Strip_Denoting_Name (Get_Formal (Assoc)); case Get_Kind (Assoc) is when Iir_Kind_Association_Element_By_Expression => declare @@ -552,7 +549,12 @@ package body Trans.Chap5 is end if; end; when Iir_Kind_Association_Element_Open => - Chap4.Elab_Object_Value (Formal, Get_Default_Value (Formal)); + declare + Value : constant Iir := Get_Default_Value (Formal); + begin + Chap4.Elab_Object_Value (Formal, Value); + Chap9.Destroy_Types (Value); + end; when Iir_Kind_Association_Element_By_Individual => -- Create the object. declare |