summaryrefslogtreecommitdiff
path: root/src/vhdl/translate/trans-chap4.adb
diff options
context:
space:
mode:
authorTristan Gingold2015-09-03 20:20:24 +0200
committerTristan Gingold2015-09-03 20:20:24 +0200
commit2d8f611cb63b72aa0373efe0ffa0df47e25519c9 (patch)
tree50d675079beccf64f6856193266cce9508fff0a0 /src/vhdl/translate/trans-chap4.adb
parent26af2bf1ad5f949e05d0e3ac560bbd22e41d7158 (diff)
downloadghdl-2d8f611cb63b72aa0373efe0ffa0df47e25519c9.tar.gz
ghdl-2d8f611cb63b72aa0373efe0ffa0df47e25519c9.tar.bz2
ghdl-2d8f611cb63b72aa0373efe0ffa0df47e25519c9.zip
Adjust previous patch (destroy types for default port values).
Diffstat (limited to 'src/vhdl/translate/trans-chap4.adb')
-rw-r--r--src/vhdl/translate/trans-chap4.adb14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vhdl/translate/trans-chap4.adb b/src/vhdl/translate/trans-chap4.adb
index 848daf8..70f4165 100644
--- a/src/vhdl/translate/trans-chap4.adb
+++ b/src/vhdl/translate/trans-chap4.adb
@@ -26,6 +26,7 @@ with Trans.Chap3;
with Trans.Chap5;
with Trans.Chap6;
with Trans.Chap7;
+with Trans.Chap9;
with Trans.Chap14;
with Trans.Rtis;
with Trans.Helpers2; use Trans.Helpers2;
@@ -1002,7 +1003,7 @@ package body Trans.Chap4 is
Sig_Type : constant Iir := Get_Type (Sig);
Base_Decl : constant Iir := Get_Object_Prefix (Sig);
Name_Node : Mnode;
- Val : Iir;
+ Value : Iir;
Data : Elab_Signal_Data;
begin
New_Debug_Line_Stmt (Get_Line_Number (Sig));
@@ -1030,12 +1031,12 @@ package body Trans.Chap4 is
if Decl = Base_Decl then
Data.Already_Resolved := False;
Data.Check_Null := Check_Null;
- Val := Get_Default_Value (Base_Decl);
- if Val = Null_Iir then
+ Value := Get_Default_Value (Base_Decl);
+ if Value = Null_Iir then
Data.Has_Val := False;
else
Data.Has_Val := True;
- Data.Val := E2M (Chap7.Translate_Expression (Val, Sig_Type),
+ Data.Val := E2M (Chap7.Translate_Expression (Value, Sig_Type),
Get_Info (Sig_Type),
Mode_Value);
end if;
@@ -1046,10 +1047,15 @@ package body Trans.Chap4 is
Data.Already_Resolved := True;
Data.Has_Val := False;
Data.Check_Null := False;
+ Value := Null_Iir;
end if;
Elab_Signal (Name_Node, Sig_Type, Data);
Close_Temp;
+
+ if Value /= Null_Iir then
+ Chap9.Destroy_Types (Value);
+ end if;
end Elab_Signal_Declaration_Object;
procedure Elab_Signal_Declaration