Commit 4f469be3 by Vincent Celier Committed by Arnaud Charlet

prj.adb (Hash (Project_Id)): New function

2008-05-20  Vincent Celier  <celier@adacore.com>

	* prj.adb (Hash (Project_Id)): New function
	(Project_Empty): Add new component Interfaces_Defined

	* prj.ads (Source_Data): New component Object_Linked
	(Language_Config): New components Object_Generated and Objects_Linked
	(Hash (Project_Id)): New function
	(Source_Data): New Boolean components In_Interfaces and
	Declared_In_Interfaces.
	(Project_Data): New Boolean component Interfaces_Defined

	* prj-attr.adb: 
	New project level attribute Object_Generated and Objects_Linked
	Add new project level attribute Interfaces

	* prj-dect.adb: Use functions Present and No throughout
	(Parse_Variable_Declaration): If a string type is specified as a simple
	name and is not found in the current project, look for it also in the
	ancestors of the project.

	* prj-makr.adb: 
	Replace procedure Make with procedures Initialize, Process and Finalize
	to implement H414-023: process different directories with different
	patterns.
	Use functions Present and No throughout

	* prj-makr.ads: 
	Replace procedure Make with procedures Initialize, Process and Finalize

	* prj-nmsc.adb
	(Add_Source): Set component Object_Exists and Object_Linked accordnig to
	the language configuration.
	(Process_Project_Level_Array_Attributes): Process new attributes
	Object_Generated and Object_Linked.
	(Report_No_Sources): New Boolean parameter Continuation, defaulted to
	False, to indicate that the erreor/warning is a continuation.
	(Check): Call Report_No_Sources with Contnuation = True after the first
	call.
	(Error_Msg): Process successively contnuation character and warning
	character.
	(Find_Explicit_Sources): Check that all declared sources have been found
	(Check_File): Indicate in hash table Source_Names when a declared source
	is found.
	(Check_File): Set Other_Part when found
	(Find_Explicit_Sources): In multi language mode, check if all exceptions
	to the naming scheme have been found. For Ada, report an error if an
	exception has not been found. Otherwise, disregard the exception.
	(Check_Interfaces): New procedure
	(Add_Source): When Other_Part is defined, set mutual pointers in spec
	and body.
	(Check): In multi-language mode, call Check_Interfaces
	(Process_Sources_In_Multi_Language_Mode): Set In_Interfaces to False
	for an excluded source.
	(Remove_Source): A source replacing a source in the interfaces is also
	in the interfaces.

	* prj-pars.adb: Use function Present

	* prj-part.adb: Use functions Present and No throughout
	(Parse_Single_Project): Set the parent project for child projects
	(Create_Virtual_Extending_Project): Register project with no qualifier
	(Parse_Single_Project): Allow an abstract project to be extend several
	times. Do not allow an abstract project to extend a non abstract
	project.

	* prj-pp.adb: Use functions Present and No throughout
	(Print): Take into account the full associative array attribute
	declarations.

	* prj-proc.adb: Use functions Present and No throughout
	(Expression): Call itself with the same From_Project_Node for the
	default value of an external reference.

	* prj-strt.adb: Use functions Present and No throughout
	(Parse_Variable_Reference): If a variable is specified as a simple name
	and is not found in the current project, look for it also in the
	ancestors of the project.

	* prj-tree.ads, prj-tree.adb (Present): New function
	(No): New function
	Use functions Present and No throughout
	(Parent_Project_Of): New function
	(Set_Parent_Project_Of): New procedure

	* snames.ads, snames.adb: 
	Add new standard names Object_Generated and Objects_Linked

From-SVN: r135623
parent 3ddca462
...@@ -86,6 +86,7 @@ package body Prj.Attr is ...@@ -86,6 +86,7 @@ package body Prj.Attr is
"LVlocally_removed_files#" & "LVlocally_removed_files#" &
"LVexcluded_source_files#" & "LVexcluded_source_files#" &
"SVsource_list_file#" & "SVsource_list_file#" &
"LVinterfaces#" &
-- Libraries -- Libraries
...@@ -109,6 +110,8 @@ package body Prj.Attr is ...@@ -109,6 +110,8 @@ package body Prj.Attr is
"LVrun_path_option#" & "LVrun_path_option#" &
"Satoolchain_version#" & "Satoolchain_version#" &
"Satoolchain_description#" & "Satoolchain_description#" &
"Saobject_generated#" &
"Saobjects_linked#" &
-- Configuration - Libraries -- Configuration - Libraries
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2007, Free Software Foundation, Inc. -- -- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -25,44 +25,58 @@ ...@@ -25,44 +25,58 @@
-- Support for procedure Gnatname -- Support for procedure Gnatname
-- For arbitrary naming schemes, create or update a project file, -- For arbitrary naming schemes, create or update a project file, or create a
-- or create a configuration pragmas file. -- configuration pragmas file.
with System.Regexp; use System.Regexp;
package Prj.Makr is package Prj.Makr is
procedure Make procedure Initialize
(File_Path : String; (File_Path : String;
Project_File : Boolean; Project_File : Boolean;
Directories : Argument_List;
Name_Patterns : Argument_List;
Excluded_Patterns : Argument_List;
Foreign_Patterns : Argument_List;
Preproc_Switches : Argument_List; Preproc_Switches : Argument_List;
Very_Verbose : Boolean); Very_Verbose : Boolean);
-- Create a project file or a configuration pragmas file -- Start the creation of a configuration pragmas file or the creation or
-- modification of a project file, for gnatname.
--
-- When Project_File is False, File_Path is the name of a configuration
-- pragmas file to create. When Project_File is True, File_Path is the name
-- of a project file to create if it does not exist or to modify if it
-- already exists.
--
-- Preproc_Switches is a list of switches to be used when invoking the
-- compiler to get the name and kind of unit of a source file.
--
-- Very_Verbose controls the verbosity of the output, in conjunction with
-- Opt.Verbose_Mode.
type Regexp_List is array (Positive range <>) of Regexp;
procedure Process
(Directories : Argument_List;
Name_Patterns : Regexp_List;
Excluded_Patterns : Regexp_List;
Foreign_Patterns : Regexp_List);
-- Look for source files in the specified directories, with the specified
-- patterns.
--
-- Directories is the list of source directories where to look for sources.
-- --
-- Project_File is the path name of the project file. If the project -- Name_Patterns is a potentially empty list of file name patterns to check
-- file already exists parse it and keep all the elements that are not -- for Ada Sources.
-- automatically generated.
-- --
-- Directory_List_File is the path name of a text file that -- Excluded_Patterns is a potentially empty list of file name patterns that
-- contains on each non empty line the path names of the source -- should not be checked for Ada or non Ada sources.
-- directories for the project file. The source directories
-- are relative to the directory of the project file.
-- --
-- File_Name_Patterns is a GNAT.Regexp string pattern such as -- Foreign_Patterns is a potentially empty list of file name patterns to
-- ".*\.ads|.*\.adb" or any other pattern. -- check for non Ada sources.
-- --
-- A project file (without any sources) is automatically generated -- At least one of Name_Patterns and Foreign_Patterns is not empty
-- with the name <project>_naming. It contains a package Naming with
-- all the specs and bodies for the project.
-- A file containing the source file names is automatically
-- generated and used as the Source_File_List for the project file.
-- It includes all sources that follow the Foreign_Patterns (except those
-- that follow Excluded_Patterns).
-- Preproc_switches is a list of optional preprocessor switches -gnatep= procedure Finalize;
-- and -gnateD that are used when invoking the compiler to find the -- Write the configuration pragmas file or the project file indicated in a
-- unit name and kind. -- call to procedure Initialize, after one or several calls to procedure
-- Process.
end Prj.Makr; end Prj.Makr;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2001-2007, Free Software Foundation, Inc. -- -- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -70,7 +70,7 @@ package body Prj.Pars is ...@@ -70,7 +70,7 @@ package body Prj.Pars is
-- If there were no error, process the tree -- If there were no error, process the tree
if Project_Node /= Empty_Node then if Present (Project_Node) then
Prj.Proc.Process Prj.Proc.Process
(In_Tree => In_Tree, (In_Tree => In_Tree,
Project => The_Project, Project => The_Project,
......
...@@ -90,6 +90,14 @@ package Prj.Tree is ...@@ -90,6 +90,14 @@ package Prj.Tree is
-- of the fields in each node of Project_Node_Kind, look at package -- of the fields in each node of Project_Node_Kind, look at package
-- Tree_Private_Part. -- Tree_Private_Part.
function Present (Node : Project_Node_Id) return Boolean;
pragma Inline (Present);
-- Return True iff Node /= Empty_Node
function No (Node : Project_Node_Id) return Boolean;
pragma Inline (No);
-- Return True iff Node = Empty_Node
procedure Initialize (Tree : Project_Node_Tree_Ref); procedure Initialize (Tree : Project_Node_Tree_Ref);
-- Initialize the Project File tree: empty the Project_Nodes table -- Initialize the Project File tree: empty the Project_Nodes table
-- and reset the Projects_Htable. -- and reset the Projects_Htable.
...@@ -262,10 +270,15 @@ package Prj.Tree is ...@@ -262,10 +270,15 @@ package Prj.Tree is
In_Tree : Project_Node_Tree_Ref) return Boolean; In_Tree : Project_Node_Tree_Ref) return Boolean;
-- Valid only for N_Comment nodes -- Valid only for N_Comment nodes
function Parent_Project_Of
(Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Project_Node_Id;
pragma Inline (Parent_Project_Of);
-- Valid only for N_Project nodes
function Project_File_Includes_Unkept_Comments function Project_File_Includes_Unkept_Comments
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) In_Tree : Project_Node_Tree_Ref) return Boolean;
return Boolean;
-- Valid only for N_Project nodes -- Valid only for N_Project nodes
function Directory_Of function Directory_Of
...@@ -631,6 +644,11 @@ package Prj.Tree is ...@@ -631,6 +644,11 @@ package Prj.Tree is
To : Project_Node_Id); To : Project_Node_Id);
pragma Inline (Set_Next_Comment); pragma Inline (Set_Next_Comment);
procedure Set_Parent_Project_Of
(Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref;
To : Project_Node_Id);
procedure Set_Project_File_Includes_Unkept_Comments procedure Set_Project_File_Includes_Unkept_Comments
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref; In_Tree : Project_Node_Tree_Ref;
...@@ -972,6 +990,9 @@ package Prj.Tree is ...@@ -972,6 +990,9 @@ package Prj.Tree is
Field3 : Project_Node_Id := Empty_Node; Field3 : Project_Node_Id := Empty_Node;
-- See below the meaning for each Project_Node_Kind -- See below the meaning for each Project_Node_Kind
Field4 : Project_Node_Id := Empty_Node;
-- See below the meaning for each Project_Node_Kind
Flag1 : Boolean := False; Flag1 : Boolean := False;
-- This flag is significant only for: -- This flag is significant only for:
-- N_Attribute_Declaration and N_Attribute_Reference -- N_Attribute_Declaration and N_Attribute_Reference
...@@ -1019,6 +1040,7 @@ package Prj.Tree is ...@@ -1019,6 +1040,7 @@ package Prj.Tree is
-- -- Field1: first with clause -- -- Field1: first with clause
-- -- Field2: project declaration -- -- Field2: project declaration
-- -- Field3: first string type -- -- Field3: first string type
-- -- Field4: parent project, if any
-- -- Value: extended project path name (if any) -- -- Value: extended project path name (if any)
-- N_With_Clause, -- N_With_Clause,
...@@ -1028,6 +1050,7 @@ package Prj.Tree is ...@@ -1028,6 +1050,7 @@ package Prj.Tree is
-- -- Field1: project node -- -- Field1: project node
-- -- Field2: next with clause -- -- Field2: next with clause
-- -- Field3: project node or empty if "limited with" -- -- Field3: project node or empty if "limited with"
-- -- Field4: not used
-- -- Value: literal string withed -- -- Value: literal string withed
-- N_Project_Declaration, -- N_Project_Declaration,
...@@ -1037,6 +1060,7 @@ package Prj.Tree is ...@@ -1037,6 +1060,7 @@ package Prj.Tree is
-- -- Field1: first declarative item -- -- Field1: first declarative item
-- -- Field2: extended project -- -- Field2: extended project
-- -- Field3: extending project -- -- Field3: extending project
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_Declarative_Item, -- N_Declarative_Item,
...@@ -1046,6 +1070,7 @@ package Prj.Tree is ...@@ -1046,6 +1070,7 @@ package Prj.Tree is
-- -- Field1: current item node -- -- Field1: current item node
-- -- Field2: next declarative item -- -- Field2: next declarative item
-- -- Field3: not used -- -- Field3: not used
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_Package_Declaration, -- N_Package_Declaration,
...@@ -1055,6 +1080,7 @@ package Prj.Tree is ...@@ -1055,6 +1080,7 @@ package Prj.Tree is
-- -- Field1: project of renamed package (if any) -- -- Field1: project of renamed package (if any)
-- -- Field2: first declarative item -- -- Field2: first declarative item
-- -- Field3: next package in project -- -- Field3: next package in project
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_String_Type_Declaration, -- N_String_Type_Declaration,
...@@ -1064,6 +1090,7 @@ package Prj.Tree is ...@@ -1064,6 +1090,7 @@ package Prj.Tree is
-- -- Field1: first literal string -- -- Field1: first literal string
-- -- Field2: next string type -- -- Field2: next string type
-- -- Field3: not used -- -- Field3: not used
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_Literal_String, -- N_Literal_String,
...@@ -1073,6 +1100,7 @@ package Prj.Tree is ...@@ -1073,6 +1100,7 @@ package Prj.Tree is
-- -- Field1: next literal string -- -- Field1: next literal string
-- -- Field2: not used -- -- Field2: not used
-- -- Field3: not used -- -- Field3: not used
-- -- Field4: not used
-- -- Value: string value -- -- Value: string value
-- N_Attribute_Declaration, -- N_Attribute_Declaration,
...@@ -1082,6 +1110,7 @@ package Prj.Tree is ...@@ -1082,6 +1110,7 @@ package Prj.Tree is
-- -- Field1: expression -- -- Field1: expression
-- -- Field2: project of full associative array -- -- Field2: project of full associative array
-- -- Field3: package of full associative array -- -- Field3: package of full associative array
-- -- Field4: not used
-- -- Value: associative array index -- -- Value: associative array index
-- -- (if an associative array element) -- -- (if an associative array element)
...@@ -1092,6 +1121,7 @@ package Prj.Tree is ...@@ -1092,6 +1121,7 @@ package Prj.Tree is
-- -- Field1: expression -- -- Field1: expression
-- -- Field2: type of variable (N_String_Type_Declaration) -- -- Field2: type of variable (N_String_Type_Declaration)
-- -- Field3: next variable -- -- Field3: next variable
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_Variable_Declaration, -- N_Variable_Declaration,
...@@ -1105,6 +1135,7 @@ package Prj.Tree is ...@@ -1105,6 +1135,7 @@ package Prj.Tree is
-- -- N_Variable_Declaration and -- -- N_Variable_Declaration and
-- -- N_Typed_Variable_Declaration -- -- N_Typed_Variable_Declaration
-- -- Field3: next variable -- -- Field3: next variable
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_Expression, -- N_Expression,
...@@ -1123,6 +1154,7 @@ package Prj.Tree is ...@@ -1123,6 +1154,7 @@ package Prj.Tree is
-- -- Field1: current term -- -- Field1: current term
-- -- Field2: next term in the expression -- -- Field2: next term in the expression
-- -- Field3: not used -- -- Field3: not used
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_Literal_String_List, -- N_Literal_String_List,
...@@ -1135,6 +1167,7 @@ package Prj.Tree is ...@@ -1135,6 +1167,7 @@ package Prj.Tree is
-- -- Field1: first expression -- -- Field1: first expression
-- -- Field2: not used -- -- Field2: not used
-- -- Field3: not used -- -- Field3: not used
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_Variable_Reference, -- N_Variable_Reference,
...@@ -1144,6 +1177,7 @@ package Prj.Tree is ...@@ -1144,6 +1177,7 @@ package Prj.Tree is
-- -- Field1: project (if specified) -- -- Field1: project (if specified)
-- -- Field2: package (if specified) -- -- Field2: package (if specified)
-- -- Field3: type of variable (N_String_Type_Declaration), if any -- -- Field3: type of variable (N_String_Type_Declaration), if any
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_External_Value, -- N_External_Value,
...@@ -1162,6 +1196,7 @@ package Prj.Tree is ...@@ -1162,6 +1196,7 @@ package Prj.Tree is
-- -- Field1: project -- -- Field1: project
-- -- Field2: package (if attribute of a package) -- -- Field2: package (if attribute of a package)
-- -- Field3: not used -- -- Field3: not used
-- -- Field4: not used
-- -- Value: associative array index -- -- Value: associative array index
-- -- (if an associative array element) -- -- (if an associative array element)
...@@ -1172,6 +1207,7 @@ package Prj.Tree is ...@@ -1172,6 +1207,7 @@ package Prj.Tree is
-- -- Field1: case variable reference -- -- Field1: case variable reference
-- -- Field2: first case item -- -- Field2: first case item
-- -- Field3: not used -- -- Field3: not used
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_Case_Item -- N_Case_Item
...@@ -1182,6 +1218,7 @@ package Prj.Tree is ...@@ -1182,6 +1218,7 @@ package Prj.Tree is
-- -- for when others -- -- for when others
-- -- Field2: first declarative item -- -- Field2: first declarative item
-- -- Field3: next case item -- -- Field3: next case item
-- -- Field4: not used
-- -- Value: not used -- -- Value: not used
-- N_Comment_zones -- N_Comment_zones
...@@ -1192,6 +1229,7 @@ package Prj.Tree is ...@@ -1192,6 +1229,7 @@ package Prj.Tree is
-- -- Field2: comment after the construct -- -- Field2: comment after the construct
-- -- Field3: comment before the "end" of the construct -- -- Field3: comment before the "end" of the construct
-- -- Value: end of line comment -- -- Value: end of line comment
-- -- Field4: not used
-- -- Comments: comment after the "end" of the construct -- -- Comments: comment after the "end" of the construct
-- N_Comment -- N_Comment
...@@ -1201,6 +1239,7 @@ package Prj.Tree is ...@@ -1201,6 +1239,7 @@ package Prj.Tree is
-- -- Field1: not used -- -- Field1: not used
-- -- Field2: not used -- -- Field2: not used
-- -- Field3: not used -- -- Field3: not used
-- -- Field4: not used
-- -- Value: comment -- -- Value: comment
-- -- Flag1: comment is preceded by an empty line -- -- Flag1: comment is preceded by an empty line
-- -- Flag2: comment is followed by an empty line -- -- Flag2: comment is followed by an empty line
...@@ -1229,13 +1268,17 @@ package Prj.Tree is ...@@ -1229,13 +1268,17 @@ package Prj.Tree is
Extended : Boolean; Extended : Boolean;
-- True when the project is being extended by another project -- True when the project is being extended by another project
Proj_Qualifier : Project_Qualifier;
-- The project qualifier of the project, if any
end record; end record;
No_Project_Name_And_Node : constant Project_Name_And_Node := No_Project_Name_And_Node : constant Project_Name_And_Node :=
(Name => No_Name, (Name => No_Name,
Node => Empty_Node, Node => Empty_Node,
Canonical_Path => No_Path, Canonical_Path => No_Path,
Extended => True); Extended => True,
Proj_Qualifier => Unspecified);
package Projects_Htable is new GNAT.Dynamic_HTables.Simple_HTable package Projects_Htable is new GNAT.Dynamic_HTables.Simple_HTable
(Header_Num => Header_Num, (Header_Num => Header_Num,
......
...@@ -122,6 +122,7 @@ package body Prj is ...@@ -122,6 +122,7 @@ package body Prj is
Sources => Nil_String, Sources => Nil_String,
First_Source => No_Source, First_Source => No_Source,
Last_Source => No_Source, Last_Source => No_Source,
Interfaces_Defined => False,
Unit_Based_Language_Name => No_Name, Unit_Based_Language_Name => No_Name,
Unit_Based_Language_Index => No_Language_Index, Unit_Based_Language_Index => No_Language_Index,
Imported_Directories_Switches => null, Imported_Directories_Switches => null,
...@@ -599,6 +600,11 @@ package body Prj is ...@@ -599,6 +600,11 @@ package body Prj is
return Hash (Get_Name_String (Name)); return Hash (Get_Name_String (Name));
end Hash; end Hash;
function Hash (Project : Project_Id) return Header_Num is
begin
return Header_Num (Project mod Max_Header_Num);
end Hash;
----------- -----------
-- Image -- -- Image --
----------- -----------
......
...@@ -307,7 +307,8 @@ package Prj is ...@@ -307,7 +307,8 @@ package Prj is
Language : Language_Index); Language : Language_Index);
-- Output the name of a language -- Output the name of a language
type Header_Num is range 0 .. 6150; Max_Header_Num : constant := 6150;
type Header_Num is range 0 .. Max_Header_Num;
-- Size for hash table below. The upper bound is an arbitrary value, the -- Size for hash table below. The upper bound is an arbitrary value, the
-- value here was chosen after testing to determine a good compromise -- value here was chosen after testing to determine a good compromise
-- between speed of access and memory usage. -- between speed of access and memory usage.
...@@ -317,6 +318,9 @@ package Prj is ...@@ -317,6 +318,9 @@ package Prj is
function Hash (Name : Path_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 -- 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
type Language_Kind is (File_Based, Unit_Based); type Language_Kind is (File_Based, Unit_Based);
-- Type for the kind of language. All languages are file based, except Ada -- Type for the kind of language. All languages are file based, except Ada
-- which is unit based. -- which is unit based.
...@@ -420,6 +424,13 @@ package Prj is ...@@ -420,6 +424,13 @@ package Prj is
-- shared libraries. Specified in the configuration. When not specified, -- shared libraries. Specified in the configuration. When not specified,
-- there is no need for such switch. -- there is no need for such switch.
Object_Generated : Boolean := True;
-- False in no object file is generated
Objects_Linked : Boolean := True;
-- False if object files are not use to link executables and build
-- libraries.
Runtime_Library_Dir : Name_Id := No_Name; Runtime_Library_Dir : Name_Id := No_Name;
-- Path name of the runtime library directory, if any -- Path name of the runtime library directory, if any
...@@ -527,6 +538,8 @@ package Prj is ...@@ -527,6 +538,8 @@ package Prj is
Compiler_Driver_Path => null, Compiler_Driver_Path => null,
Compiler_Required_Switches => No_Name_List, Compiler_Required_Switches => No_Name_List,
Compilation_PIC_Option => No_Name_List, Compilation_PIC_Option => No_Name_List,
Object_Generated => True,
Objects_Linked => True,
Runtime_Library_Dir => No_Name, Runtime_Library_Dir => No_Name,
Mapping_File_Switches => No_Name_List, Mapping_File_Switches => No_Name_List,
Mapping_Spec_Suffix => No_File, Mapping_Spec_Suffix => No_File,
...@@ -616,6 +629,13 @@ package Prj is ...@@ -616,6 +629,13 @@ package Prj is
Compiled : Boolean := True; Compiled : Boolean := True;
-- False when there is no compiler for the language -- False when there is no compiler for the language
In_Interfaces : Boolean := True;
-- False when the source is not included in interfaces, when attribute
-- Interfaces is declared.
Declared_In_Interfaces : Boolean := False;
-- True when source is declared in attribute Interfaces
Alternate_Languages : Alternate_Language_Id := No_Alternate_Language; Alternate_Languages : Alternate_Language_Id := No_Alternate_Language;
-- List of languages a header file may also be, in addition of -- List of languages a header file may also be, in addition of
-- language Language_Name. -- language Language_Name.
...@@ -667,6 +687,10 @@ package Prj is ...@@ -667,6 +687,10 @@ package Prj is
Object_Exists : Boolean := True; Object_Exists : Boolean := True;
-- True if an object file exists -- True if an object file exists
Object_Linked : Boolean := True;
-- False if the object file is not use to link executables or included
-- in libraries.
Object : File_Name_Type := No_File; Object : File_Name_Type := No_File;
-- File name of the object file -- File name of the object file
...@@ -714,42 +738,45 @@ package Prj is ...@@ -714,42 +738,45 @@ package Prj is
end record; end record;
No_Source_Data : constant Source_Data := No_Source_Data : constant Source_Data :=
(Project => No_Project, (Project => No_Project,
Language_Name => No_Name, Language_Name => No_Name,
Language => No_Language_Index, Language => No_Language_Index,
Lang_Kind => File_Based, Lang_Kind => File_Based,
Compiled => True, Compiled => True,
Alternate_Languages => No_Alternate_Language, In_Interfaces => True,
Kind => Spec, Declared_In_Interfaces => False,
Dependency => None, Alternate_Languages => No_Alternate_Language,
Other_Part => No_Source, Kind => Spec,
Unit => No_Name, Dependency => None,
Index => 0, Other_Part => No_Source,
Locally_Removed => False, Unit => No_Name,
Get_Object => False, Index => 0,
Replaced_By => No_Source, Locally_Removed => False,
File => No_File, Get_Object => False,
Display_File => No_File, Replaced_By => No_Source,
Path => No_Path, File => No_File,
Display_Path => No_Path, Display_File => No_File,
Source_TS => Empty_Time_Stamp, Path => No_Path,
Object_Project => No_Project, Display_Path => No_Path,
Object_Exists => True, Source_TS => Empty_Time_Stamp,
Object => No_File, Object_Project => No_Project,
Current_Object_Path => No_Path, Object_Exists => True,
Object_Path => No_Path, Object_Linked => True,
Object_TS => Empty_Time_Stamp, Object => No_File,
Dep_Name => No_File, Current_Object_Path => No_Path,
Current_Dep_Path => No_Path, Object_Path => No_Path,
Dep_Path => No_Path, Object_TS => Empty_Time_Stamp,
Dep_TS => Empty_Time_Stamp, Dep_Name => No_File,
Switches => No_File, Current_Dep_Path => No_Path,
Switches_Path => No_Path, Dep_Path => No_Path,
Switches_TS => Empty_Time_Stamp, Dep_TS => Empty_Time_Stamp,
Naming_Exception => False, Switches => No_File,
Next_In_Sources => No_Source, Switches_Path => No_Path,
Next_In_Project => No_Source, Switches_TS => Empty_Time_Stamp,
Next_In_Lang => No_Source); Naming_Exception => False,
Next_In_Sources => No_Source,
Next_In_Project => No_Source,
Next_In_Lang => No_Source);
package Source_Data_Table is new GNAT.Dynamic_Tables package Source_Data_Table is new GNAT.Dynamic_Tables
(Table_Component_Type => Source_Data, (Table_Component_Type => Source_Data,
...@@ -1267,9 +1294,6 @@ package Prj is ...@@ -1267,9 +1294,6 @@ package Prj is
Dir_Path : String_Access; Dir_Path : String_Access;
-- Same as Directory, but as an access to String -- Same as Directory, but as an access to String
Library : Boolean := False;
-- True if this is a library project
Library_Dir : Path_Name_Type := No_Path; Library_Dir : Path_Name_Type := No_Path;
-- If a library project, path name of the directory where the library -- If a library project, path name of the directory where the library
-- resides. -- resides.
...@@ -1303,6 +1327,9 @@ package Prj is ...@@ -1303,6 +1327,9 @@ package Prj is
-- be different from Library_ALI_Dir for platforms where the file names -- be different from Library_ALI_Dir for platforms where the file names
-- are case-insensitive. -- are case-insensitive.
Library : Boolean := False;
-- True if this is a library project
Library_Name : Name_Id := No_Name; Library_Name : Name_Id := No_Name;
-- If a library project, name of the library -- If a library project, name of the library
...@@ -1339,6 +1366,10 @@ package Prj is ...@@ -1339,6 +1366,10 @@ package Prj is
Last_Source : Source_Id := No_Source; Last_Source : Source_Id := No_Source;
-- Head and tail of the list of sources -- Head and tail of the list of sources
Interfaces_Defined : Boolean := False;
-- True if attribute Interfaces is declared for the project or any
-- project it extends.
Unit_Based_Language_Name : Name_Id := No_Name; Unit_Based_Language_Name : Name_Id := No_Name;
Unit_Based_Language_Index : Language_Index := No_Language_Index; Unit_Based_Language_Index : Language_Index := No_Language_Index;
-- The name and index, if any, of the unit-based language of some -- The name and index, if any, of the unit-based language of some
......
...@@ -771,6 +771,8 @@ package body Snames is ...@@ -771,6 +771,8 @@ package body Snames is
"mapping_body_suffix#" & "mapping_body_suffix#" &
"metrics#" & "metrics#" &
"naming#" & "naming#" &
"object_generated#" &
"objects_linked#" &
"objects_path#" & "objects_path#" &
"objects_path_file#" & "objects_path_file#" &
"object_dir#" & "object_dir#" &
......
...@@ -1092,56 +1092,58 @@ package Snames is ...@@ -1092,56 +1092,58 @@ package Snames is
Name_Mapping_Body_Suffix : constant Name_Id := N + 710; Name_Mapping_Body_Suffix : constant Name_Id := N + 710;
Name_Metrics : constant Name_Id := N + 711; Name_Metrics : constant Name_Id := N + 711;
Name_Naming : constant Name_Id := N + 712; Name_Naming : constant Name_Id := N + 712;
Name_Objects_Path : constant Name_Id := N + 713; Name_Object_Generated : constant Name_Id := N + 713;
Name_Objects_Path_File : constant Name_Id := N + 714; Name_Objects_Linked : constant Name_Id := N + 714;
Name_Object_Dir : constant Name_Id := N + 715; Name_Objects_Path : constant Name_Id := N + 715;
Name_Pic_Option : constant Name_Id := N + 716; Name_Objects_Path_File : constant Name_Id := N + 716;
Name_Pretty_Printer : constant Name_Id := N + 717; Name_Object_Dir : constant Name_Id := N + 717;
Name_Prefix : constant Name_Id := N + 718; Name_Pic_Option : constant Name_Id := N + 718;
Name_Project : constant Name_Id := N + 719; Name_Pretty_Printer : constant Name_Id := N + 719;
Name_Roots : constant Name_Id := N + 720; Name_Prefix : constant Name_Id := N + 720;
Name_Required_Switches : constant Name_Id := N + 721; Name_Project : constant Name_Id := N + 721;
Name_Run_Path_Option : constant Name_Id := N + 722; Name_Roots : constant Name_Id := N + 722;
Name_Runtime_Project : constant Name_Id := N + 723; Name_Required_Switches : constant Name_Id := N + 723;
Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 724; Name_Run_Path_Option : constant Name_Id := N + 724;
Name_Shared_Library_Prefix : constant Name_Id := N + 725; Name_Runtime_Project : constant Name_Id := N + 725;
Name_Shared_Library_Suffix : constant Name_Id := N + 726; Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 726;
Name_Separate_Suffix : constant Name_Id := N + 727; Name_Shared_Library_Prefix : constant Name_Id := N + 727;
Name_Source_Dirs : constant Name_Id := N + 728; Name_Shared_Library_Suffix : constant Name_Id := N + 728;
Name_Source_Files : constant Name_Id := N + 729; Name_Separate_Suffix : constant Name_Id := N + 729;
Name_Source_List_File : constant Name_Id := N + 730; Name_Source_Dirs : constant Name_Id := N + 730;
Name_Spec : constant Name_Id := N + 731; Name_Source_Files : constant Name_Id := N + 731;
Name_Spec_Suffix : constant Name_Id := N + 732; Name_Source_List_File : constant Name_Id := N + 732;
Name_Specification : constant Name_Id := N + 733; Name_Spec : constant Name_Id := N + 733;
Name_Specification_Exceptions : constant Name_Id := N + 734; Name_Spec_Suffix : constant Name_Id := N + 734;
Name_Specification_Suffix : constant Name_Id := N + 735; Name_Specification : constant Name_Id := N + 735;
Name_Stack : constant Name_Id := N + 736; Name_Specification_Exceptions : constant Name_Id := N + 736;
Name_Switches : constant Name_Id := N + 737; Name_Specification_Suffix : constant Name_Id := N + 737;
Name_Symbolic_Link_Supported : constant Name_Id := N + 738; Name_Stack : constant Name_Id := N + 738;
Name_Sync : constant Name_Id := N + 739; Name_Switches : constant Name_Id := N + 739;
Name_Synchronize : constant Name_Id := N + 740; Name_Symbolic_Link_Supported : constant Name_Id := N + 740;
Name_Toolchain_Description : constant Name_Id := N + 741; Name_Sync : constant Name_Id := N + 741;
Name_Toolchain_Version : constant Name_Id := N + 742; Name_Synchronize : constant Name_Id := N + 742;
Name_Runtime_Library_Dir : constant Name_Id := N + 743; Name_Toolchain_Description : constant Name_Id := N + 743;
Name_Toolchain_Version : constant Name_Id := N + 744;
Name_Runtime_Library_Dir : constant Name_Id := N + 745;
-- Other miscellaneous names used in front end -- Other miscellaneous names used in front end
Name_Unaligned_Valid : constant Name_Id := N + 744; Name_Unaligned_Valid : constant Name_Id := N + 746;
-- Ada 2005 reserved words -- Ada 2005 reserved words
First_2005_Reserved_Word : constant Name_Id := N + 745; First_2005_Reserved_Word : constant Name_Id := N + 747;
Name_Interface : constant Name_Id := N + 745; Name_Interface : constant Name_Id := N + 747;
Name_Overriding : constant Name_Id := N + 746; Name_Overriding : constant Name_Id := N + 748;
Name_Synchronized : constant Name_Id := N + 747; Name_Synchronized : constant Name_Id := N + 749;
Last_2005_Reserved_Word : constant Name_Id := N + 747; Last_2005_Reserved_Word : constant Name_Id := N + 749;
subtype Ada_2005_Reserved_Words is subtype Ada_2005_Reserved_Words is
Name_Id range First_2005_Reserved_Word .. Last_2005_Reserved_Word; Name_Id range First_2005_Reserved_Word .. Last_2005_Reserved_Word;
-- Mark last defined name for consistency check in Snames body -- Mark last defined name for consistency check in Snames body
Last_Predefined_Name : constant Name_Id := N + 747; Last_Predefined_Name : constant Name_Id := N + 749;
--------------------------------------- ---------------------------------------
-- Subtypes Defining Name Categories -- -- Subtypes Defining Name Categories --
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment