diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-12-30 10:29:16 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-12-30 10:29:16 +0100 |
commit | f1c30ad16e0914455ee2c84e80714f6b271021f2 (patch) | |
tree | 11ebb7a91faeed8c17fdaf84cd8cd14d334d8c6a /src/vhdl | |
parent | 56dde6c446367f85882d288d7606015ace7f80ed (diff) | |
download | ghdl-f1c30ad16e0914455ee2c84e80714f6b271021f2.tar.gz ghdl-f1c30ad16e0914455ee2c84e80714f6b271021f2.tar.bz2 ghdl-f1c30ad16e0914455ee2c84e80714f6b271021f2.zip |
Rework initialization and finalization.
libghdl can now be re-initialized.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/libghdl/libghdl.ads | 3 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.adb | 6 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.adb.in | 6 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.ads | 5 |
4 files changed, 16 insertions, 4 deletions
diff --git a/src/vhdl/libghdl/libghdl.ads b/src/vhdl/libghdl/libghdl.ads index 5326666b8..de2556069 100644 --- a/src/vhdl/libghdl/libghdl.ads +++ b/src/vhdl/libghdl/libghdl.ads @@ -36,7 +36,8 @@ package Libghdl is -- To be called before Analyze_File to initialize analysis. function Analyze_Init_Status return Integer; - -- Deprecated. Raise an exception in case of error. + -- Deprecated, use Analyze_Init_Status instead. + -- Raise an exception in case of error. procedure Analyze_Init; -- Analyze one file. diff --git a/src/vhdl/vhdl-nodes.adb b/src/vhdl/vhdl-nodes.adb index f02857bd4..b879ba275 100644 --- a/src/vhdl/vhdl-nodes.adb +++ b/src/vhdl/vhdl-nodes.adb @@ -741,10 +741,14 @@ package body Vhdl.Nodes is procedure Initialize is begin - Nodet.Free; Nodet.Init; end Initialize; + procedure Finalize is + begin + Nodet.Free; + end Finalize; + function Is_Null (Node : Iir) return Boolean is begin return Node = Null_Iir; diff --git a/src/vhdl/vhdl-nodes.adb.in b/src/vhdl/vhdl-nodes.adb.in index e35ed1832..5f98405a3 100644 --- a/src/vhdl/vhdl-nodes.adb.in +++ b/src/vhdl/vhdl-nodes.adb.in @@ -741,10 +741,14 @@ package body Vhdl.Nodes is procedure Initialize is begin - Nodet.Free; Nodet.Init; end Initialize; + procedure Finalize is + begin + Nodet.Free; + end Finalize; + function Is_Null (Node : Iir) return Boolean is begin return Node = Null_Iir; diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads index fb92c5882..855dccebd 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -7338,9 +7338,12 @@ package Vhdl.Nodes is type Free_Iir_Hook is access procedure (N : Iir); procedure Register_Free_Hook (Hook : Free_Iir_Hook); - -- Free all and reinit. + -- Initialize. procedure Initialize; + -- Free all the memory. + procedure Finalize; + -- Disp statistics about node usage. procedure Disp_Stats; |