aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/elab-vhdl_objtypes.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-04-30 16:47:18 +0200
committerTristan Gingold <tgingold@free.fr>2022-04-30 16:47:18 +0200
commit89a364a5fb48e9ef0f7a30b94adaa4c64c6faa18 (patch)
tree0ea12e17b43bf34f173b88825a73fa6eade3b8f9 /src/synth/elab-vhdl_objtypes.adb
parent399f99cb22ca3fc54f5b9adc85c0cabaae1328c4 (diff)
downloadghdl-89a364a5fb48e9ef0f7a30b94adaa4c64c6faa18.tar.gz
ghdl-89a364a5fb48e9ef0f7a30b94adaa4c64c6faa18.tar.bz2
ghdl-89a364a5fb48e9ef0f7a30b94adaa4c64c6faa18.zip
elab-vhdl_objtypes: fix restart of libghdl
Diffstat (limited to 'src/synth/elab-vhdl_objtypes.adb')
-rw-r--r--src/synth/elab-vhdl_objtypes.adb22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/synth/elab-vhdl_objtypes.adb b/src/synth/elab-vhdl_objtypes.adb
index ba475a723..3715e0532 100644
--- a/src/synth/elab-vhdl_objtypes.adb
+++ b/src/synth/elab-vhdl_objtypes.adb
@@ -822,9 +822,11 @@ package body Elab.Vhdl_Objtypes is
function To_Memory_Ptr is new Ada.Unchecked_Conversion
(Address, Memory_Ptr);
- procedure Init is
+ procedure Initialize is
begin
- pragma Assert (Boolean_Type = null);
+ if Boolean_Type /= null then
+ Release (Empty_Marker, Global_Pool);
+ end if;
Instance_Pool := Global_Pool'Access;
Boolean_Type := Create_Bit_Type;
@@ -833,5 +835,19 @@ package body Elab.Vhdl_Objtypes is
Bit0 := (Bit_Type, To_Memory_Ptr (Bit0_Mem'Address));
Bit1 := (Bit_Type, To_Memory_Ptr (Bit1_Mem'Address));
- end Init;
+ end Initialize;
+
+ procedure Finalize is
+ begin
+ pragma Assert (Boolean_Type /= null);
+ Release (Empty_Marker, Global_Pool);
+
+ Instance_Pool := null;
+ Boolean_Type := null;
+ Logic_Type := null;
+ Bit_Type := null;
+
+ Bit0 := Null_Memtyp;
+ Bit1 := Null_Memtyp;
+ end Finalize;
end Elab.Vhdl_Objtypes;