From b6c523106ab498375a7874923742c6b806700a9a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 14 Nov 2018 18:35:41 +0100 Subject: Create sem_lib from libraries. --- src/libraries.ads | 51 +++++++-------------------------------------------- 1 file changed, 7 insertions(+), 44 deletions(-) (limited to 'src/libraries.ads') diff --git a/src/libraries.ads b/src/libraries.ads index e8060c522..df2843d7a 100644 --- a/src/libraries.ads +++ b/src/libraries.ads @@ -99,25 +99,6 @@ package Libraries is -- Save the work library as a host-dependent library. procedure Save_Work_Library; - -- Start the analyse a file (ie load and parse it). - -- The file is read from the current directory (unless FILE_NAME is an - -- absolute path). - -- Emit an error if the file cannot be opened. - -- Return NULL_IIR in case of parse error. - function Load_File (File_Name: Name_Id) return Iir_Design_File; - function Load_File (File : Source_File_Entry) return Iir_Design_File; - - -- Load, parse, analyze, back-end a design_unit if necessary. - -- Check Design_Unit is not obsolete. - -- LOC is the location where the design unit was needed, in case of error. - procedure Load_Design_Unit (Design_Unit: Iir_Design_Unit; Loc : Iir); - - -- Load and parse DESIGN_UNIT. - -- Contrary to Load_Design_Unit, the design_unit is not analyzed. - -- Also, the design_unit must not have been already loaded. - -- Used almost only by Load_Design_Unit. - procedure Load_Parse_Design_Unit (Design_Unit: Iir_Design_Unit; Loc : Iir); - -- Remove the same file as DESIGN_FILE from work library and all of its -- units. procedure Purge_Design_File (Design_File : Iir_Design_File); @@ -127,31 +108,6 @@ package Libraries is (Library: Iir_Library_Declaration; Name: Name_Id) return Iir_Design_Unit; - -- Load an already analyzed primary unit NAME from library LIBRARY - -- and compile it. - -- Return NULL_IIR if not found (ie, NAME does not correspond to a - -- library unit identifier). - function Load_Primary_Unit - (Library: Iir_Library_Declaration; Name: Name_Id; Loc : Iir) - return Iir_Design_Unit; - - -- Find the secondary unit of PRIMARY. - -- If PRIMARY is a package declaration, returns the package body, - -- If PRIMARY is an entity declaration, returns the architecture NAME. - -- Return NULL_IIR if not found. - function Find_Secondary_Unit (Primary: Iir_Design_Unit; Name: Name_Id) - return Iir_Design_Unit; - - -- Load an secondary unit of primary unit PRIMARY and analyse it. - -- NAME must be set only for an architecture. - function Load_Secondary_Unit - (Primary: Iir_Design_Unit; Name: Name_Id; Loc : Iir) - return Iir_Design_Unit; - - -- Analyze UNIT. - procedure Finish_Compilation - (Unit : Iir_Design_Unit; Main : Boolean := False); - -- Get or create a library from an identifier. -- LOC is used only to report errors. function Get_Library (Ident : Name_Id; Loc : Location_Type) @@ -190,6 +146,13 @@ package Libraries is -- Return null_iir if the design unit is not found. function Find_Design_Unit (Unit : Iir) return Iir_Design_Unit; + -- Find the secondary unit of PRIMARY. + -- If PRIMARY is a package declaration, returns the package body, + -- If PRIMARY is an entity declaration, returns the architecture NAME. + -- Return NULL_IIR if not found. + function Find_Secondary_Unit (Primary: Iir_Design_Unit; Name: Name_Id) + return Iir_Design_Unit; + -- Search design file NAME in library LIB. This is not very efficient as -- this is a simple linear search. NAME must correspond exactely to the -- design file name. -- cgit v1.2.3