diff options
Diffstat (limited to 'gcc/ada/prj.ads')
-rw-r--r-- | gcc/ada/prj.ads | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index b4d6172..a0ccdbe 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -160,8 +160,9 @@ package Prj is No_Path_Information : constant Path_Information := (No_Path, No_Path); - type Project_Id is new Nat; - No_Project : constant Project_Id := 0; + type Project_Data; + type Project_Id is access Project_Data; + No_Project : constant Project_Id := null; -- Id of a Project File type String_List_Id is new Nat; @@ -323,10 +324,8 @@ package Prj is function Hash (Name : Name_Id) return Header_Num; function Hash (Name : File_Name_Type) return Header_Num; function Hash (Name : Path_Name_Type) return Header_Num; - -- Used for computing hash values for names put into above hash table - function Hash (Project : Project_Id) return Header_Num; - -- Used for hash tables where Project_Id is the Key + -- Used for computing hash values for names put into above hash table type Language_Kind is (File_Based, Unit_Based); -- Type for the kind of language. All languages are file based, except Ada @@ -896,8 +895,7 @@ package Prj is Suffix : File_Name_Type); function Get_Object_Directory - (In_Tree : Project_Tree_Ref; - Project : Project_Id; + (Project : Project_Id; Including_Libraries : Boolean; Only_If_Ada : Boolean := False) return Path_Name_Type; -- Return the object directory to use for the project. This depends on @@ -908,13 +906,12 @@ package Prj is -- If Only_If_Ada is True, then No_Name will be returned when the project -- doesn't Ada sources. - procedure Compute_All_Imported_Projects - (Project : Project_Id; In_Tree : Project_Tree_Ref); + procedure Compute_All_Imported_Projects (Project : Project_Id); -- Compute, the list of the projects imported directly or indirectly by -- project Project. The result is stored in Project.All_Imported_Projects function Ultimate_Extending_Project_Of - (Proj : Project_Id; In_Tree : Project_Tree_Ref) return Project_Id; + (Proj : Project_Id) return Project_Id; -- Returns the ultimate extending project of project Proj. If project Proj -- is not extended, returns Proj. @@ -938,6 +935,14 @@ package Prj is end record; -- A list of projects + procedure Free_List + (List : in out Project_List; + Free_Project : Boolean; + Reset_Only : Boolean := True); + -- Free the list of projects. If Free_Project, each project is also freed. + -- When Free_Project is True, Reset_Only indicates whether the specific + -- languages should also be freed. + type Response_File_Format is (None, GNU, @@ -1317,33 +1322,24 @@ package Prj is function Is_Extending (Extending : Project_Id; - Extended : Project_Id; - In_Tree : Project_Tree_Ref) return Boolean; - -- ??? needs comment + Extended : Project_Id) return Boolean; + -- Return True if Extending is extending the Extended project. function Is_A_Language - (Data : Project_Data; + (Project : Project_Id; Language_Name : Name_Id) return Boolean; -- Return True when Language_Name (which must be lower case) is one of the -- languages used for the project. - function Has_Ada_Sources (Data : Project_Data) return Boolean; + function Has_Ada_Sources (Data : Project_Id) return Boolean; -- Return True if the project has Ada sources - function Has_Foreign_Sources (Data : Project_Data) return Boolean; + function Has_Foreign_Sources (Data : Project_Id) return Boolean; -- Return True if the project has foreign sources Project_Error : exception; -- Raised by some subprograms in Prj.Attr - package Project_Table is new GNAT.Dynamic_Tables ( - Table_Component_Type => Project_Data, - Table_Index_Type => Project_Id, - Table_Low_Bound => 1, - Table_Initial => 100, - Table_Increment => 100); - -- The set of all project files - type Spec_Or_Body is (Specification, Body_Part); type File_Name_Data is record @@ -1427,7 +1423,7 @@ package Prj is Array_Elements : Array_Element_Table.Instance; Arrays : Array_Table.Instance; Packages : Package_Table.Instance; - Projects : Project_Table.Instance; + Projects : Project_List; Units : Unit_Table.Instance; Units_HT : Units_Htable.Instance; Source_Paths_HT : Source_Paths_Htable.Instance; @@ -1486,7 +1482,6 @@ package Prj is With_State : in out State); procedure For_Every_Project_Imported (By : Project_Id; - In_Tree : Project_Tree_Ref; With_State : in out State; Imported_First : Boolean := False); -- Call Action for each project imported directly or indirectly by project @@ -1560,7 +1555,7 @@ private type Source_Iterator is record In_Tree : Project_Tree_Ref; - Project : Project_Id; + Project : Project_List; All_Projects : Boolean; -- Current project and whether we should move on to the next |