aboutsummaryrefslogtreecommitdiffstats
path: root/src/libraries.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-12-30 10:29:16 +0100
committerTristan Gingold <tgingold@free.fr>2020-12-30 10:29:16 +0100
commitf1c30ad16e0914455ee2c84e80714f6b271021f2 (patch)
tree11ebb7a91faeed8c17fdaf84cd8cd14d334d8c6a /src/libraries.adb
parent56dde6c446367f85882d288d7606015ace7f80ed (diff)
downloadghdl-f1c30ad16e0914455ee2c84e80714f6b271021f2.tar.gz
ghdl-f1c30ad16e0914455ee2c84e80714f6b271021f2.tar.bz2
ghdl-f1c30ad16e0914455ee2c84e80714f6b271021f2.zip
Rework initialization and finalization.
libghdl can now be re-initialized.
Diffstat (limited to 'src/libraries.adb')
-rw-r--r--src/libraries.adb27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/libraries.adb b/src/libraries.adb
index 42228ea6c..14526497d 100644
--- a/src/libraries.adb
+++ b/src/libraries.adb
@@ -15,22 +15,25 @@
-- along with GHDL; see the file COPYING. If not, write to the Free
-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-- 02111-1307, USA.
-with Interfaces.C_Streams;
with System;
+with Interfaces.C_Streams;
with GNAT.OS_Lib;
+
with Logging; use Logging;
with Tables;
with Errorout; use Errorout;
with Options; use Options;
-with Vhdl.Errors; use Vhdl.Errors;
-with Vhdl.Scanner;
-with Vhdl.Utils; use Vhdl.Utils;
with Name_Table; use Name_Table;
with Str_Table;
-with Vhdl.Tokens;
with Files_Map;
with Flags;
+with Std_Names;
+
+with Vhdl.Tokens;
with Vhdl.Std_Package;
+with Vhdl.Errors; use Vhdl.Errors;
+with Vhdl.Scanner;
+with Vhdl.Utils; use Vhdl.Utils;
package body Libraries is
-- Chain of known libraries. This is also the top node of all iir node.
@@ -69,17 +72,27 @@ package body Libraries is
-- Initialize paths table.
-- Set the local path.
- procedure Init_Paths is
+ procedure Initialize is
begin
-- Always look in current directory first.
+ Paths.Init;
Name_Nil := Get_Identifier ("");
Paths.Append (Name_Nil);
Local_Directory := Name_Nil;
Work_Directory := Name_Nil;
+ Libraries_Chain := Null_Iir;
+ Std_Library := Null_Iir;
+ Work_Library_Name := Std_Names.Name_Work;
+
Create_Virtual_Locations;
- end Init_Paths;
+ end Initialize;
+
+ procedure Finalize is
+ begin
+ Paths.Free;
+ end Finalize;
function Path_To_Id (Path : String) return Name_Id is
begin