aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-12-06 18:16:59 +0100
committerTristan Gingold <tgingold@free.fr>2022-12-06 18:16:59 +0100
commit0ab45a7186882093a2f619f165ff66e4a22fac76 (patch)
tree30ac912c280e798245d07fb6e43f3dec43430c96
parent93cb47c448978def5fc72674fae13a2622190695 (diff)
downloadghdl-0ab45a7186882093a2f619f165ff66e4a22fac76.tar.gz
ghdl-0ab45a7186882093a2f619f165ff66e4a22fac76.tar.bz2
ghdl-0ab45a7186882093a2f619f165ff66e4a22fac76.zip
file_comments: add Initialize and Finalize
-rw-r--r--src/file_comments.adb13
-rw-r--r--src/file_comments.ads4
-rw-r--r--src/options.adb3
3 files changed, 20 insertions, 0 deletions
diff --git a/src/file_comments.adb b/src/file_comments.adb
index ef292c43f..d984d7d04 100644
--- a/src/file_comments.adb
+++ b/src/file_comments.adb
@@ -399,4 +399,17 @@ package body File_Comments is
return No_Comment_Index;
end if;
end Get_Next_Comment;
+
+ procedure Finalize is
+ begin
+ for I in Comments_Table.First .. Comments_Table.Last loop
+ File_Comments_Tables.Free (Comments_Table.Table (I));
+ end loop;
+ Comments_Table.Free;
+ end Finalize;
+
+ procedure Initialize is
+ begin
+ Comments_Table.Init;
+ end Initialize;
end File_Comments;
diff --git a/src/file_comments.ads b/src/file_comments.ads
index 0869ed31b..8bb4d117d 100644
--- a/src/file_comments.ads
+++ b/src/file_comments.ads
@@ -91,6 +91,10 @@ package File_Comments is
function Get_Next_Comment (File : Source_File_Entry;
Idx : Comment_Index)
return Comment_Index;
+
+ -- For the whole package.
+ procedure Initialize;
+ procedure Finalize;
private
type Comments_Range is record
-- Range of saved comments.
diff --git a/src/options.adb b/src/options.adb
index 0bff712b9..44abdb2c4 100644
--- a/src/options.adb
+++ b/src/options.adb
@@ -25,6 +25,7 @@ with PSL.Nodes;
with PSL.Dump_Tree;
with Flags; use Flags;
with Files_Map;
+with File_Comments;
with Vhdl.Nodes;
with Vhdl.Lists;
@@ -46,6 +47,7 @@ package body Options is
Vhdl.Nodes.Initialize;
Elab.Vhdl_Objtypes.Initialize;
Files_Map.Initialize;
+ File_Comments.Initialize;
Libraries.Initialize;
PSL.Nodes.Init (Libraries.Library_Location);
PSL.Dump_Tree.Dump_Hdl_Node := Vhdl.Disp_Tree.Disp_Tree_For_Psl'Access;
@@ -60,6 +62,7 @@ package body Options is
Vhdl.Nodes.Finalize;
Elab.Vhdl_Objtypes.Finalize;
Files_Map.Finalize;
+ File_Comments.Finalize;
Libraries.Finalize;
-- TODO: finalize errors (reset counters, handlers...)
-- TODO: PSL