diff options
-rw-r--r-- | src/file_comments.adb | 13 | ||||
-rw-r--r-- | src/file_comments.ads | 4 | ||||
-rw-r--r-- | src/options.adb | 3 |
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 |