Commit ca311c9f by Vincent Celier Committed by Arnaud Charlet

prj-part.adb, [...]: Move back spec of Parse_Single_Project to body...

2008-07-31  Vincent Celier  <celier@adacore.com>

	* prj-part.adb, prj-part.ads, prj.adb, prj.ads, prj-env.adb:
	Move back spec of Parse_Single_Project to body, as it is not called
	outside of package Prj.Part.
	(Project_Data): Remove components Linker_Name, Linker_Path and
	Minimum_Linker_Options as they are no longer set.
	Remove function There_Are_Ada_Sources from package Prj and move code
	in the only place it was used, in Prj.Env.Set_Ada_Paths.

From-SVN: r138394
parent 58fda84d
...@@ -2355,16 +2355,36 @@ package body Prj.Env is ...@@ -2355,16 +2355,36 @@ package body Prj.Env is
-- For a non-library project, add the object -- For a non-library project, add the object
-- directory, if it is not a virtual project, and if -- directory, if it is not a virtual project, and if
-- there are Ada sources or if the project is an -- there are Ada sources in the project or one of the
-- extending project. If there are no Ada sources, -- projects it extends. If there are no Ada sources,
-- adding the object directory could disrupt the order -- adding the object directory could disrupt the order
-- of the object dirs in the path. -- of the object dirs in the path.
elsif not Data.Virtual elsif not Data.Virtual then
and then There_Are_Ada_Sources (In_Tree, Project) declare
then Add_Object_Dir : Boolean := False;
Add_To_Object_Path Prj : Project_Id := Project;
(Data.Object_Directory.Name, In_Tree);
begin
while not Add_Object_Dir
and then Prj /= No_Project
loop
if In_Tree.Projects.Table
(Prj).Ada_Sources /= Nil_String
then
Add_Object_Dir := True;
else
Prj :=
In_Tree.Projects.Table (Prj).Extends;
end if;
end loop;
if Add_Object_Dir then
Add_To_Object_Path
(Data.Object_Directory.Name, In_Tree);
end if;
end;
end if; end if;
end if; end if;
end if; end if;
......
...@@ -149,6 +149,30 @@ package body Prj.Part is ...@@ -149,6 +149,30 @@ package body Prj.Part is
-- does not (because it is already extended), but other projects that it -- does not (because it is already extended), but other projects that it
-- imports may need to be virtually extended. -- imports may need to be virtually extended.
type Extension_Origin is (None, Extending_Simple, Extending_All);
-- Type of parameter From_Extended for procedures Parse_Single_Project and
-- Post_Parse_Context_Clause. Extending_All means that we are parsing the
-- tree rooted at an extending all project.
procedure Parse_Single_Project
(In_Tree : Project_Node_Tree_Ref;
Project : out Project_Node_Id;
Extends_All : out Boolean;
Path_Name : String;
Extended : Boolean;
From_Extended : Extension_Origin;
In_Limited : Boolean;
Packages_To_Check : String_List_Access;
Depth : Natural;
Current_Dir : String);
-- Parse a project file.
-- Recursive procedure: it calls itself for imported and extended
-- projects. When From_Extended is not None, if the project has already
-- been parsed and is an extended project A, return the ultimate
-- (not extended) project that extends A. When In_Limited is True,
-- the importing path includes at least one "limited with".
-- When parsing configuration projects, do not allow a depth > 1.
procedure Pre_Parse_Context_Clause procedure Pre_Parse_Context_Clause
(In_Tree : Project_Node_Tree_Ref; (In_Tree : Project_Node_Tree_Ref;
Context_Clause : out With_Id); Context_Clause : out With_Id);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2000-2007, Free Software Foundation, Inc. -- -- Copyright (C) 2000-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- --
...@@ -49,28 +49,4 @@ package Prj.Part is ...@@ -49,28 +49,4 @@ package Prj.Part is
-- Current_Directory is used for optimization purposes only, avoiding extra -- Current_Directory is used for optimization purposes only, avoiding extra
-- system calls. -- system calls.
type Extension_Origin is (None, Extending_Simple, Extending_All);
-- Type of parameter From_Extended for procedures Parse_Single_Project and
-- Post_Parse_Context_Clause. Extending_All means that we are parsing the
-- tree rooted at an extending all project.
procedure Parse_Single_Project
(In_Tree : Project_Node_Tree_Ref;
Project : out Project_Node_Id;
Extends_All : out Boolean;
Path_Name : String;
Extended : Boolean;
From_Extended : Extension_Origin;
In_Limited : Boolean;
Packages_To_Check : String_List_Access;
Depth : Natural;
Current_Dir : String);
-- Parse a project file.
-- Recursive procedure: it calls itself for imported and extended
-- projects. When From_Extended is not None, if the project has already
-- been parsed and is an extended project A, return the ultimate
-- (not extended) project that extends A. When In_Limited is True,
-- the importing path includes at least one "limited with".
-- When parsing configuration projects, do not allow a depth > 1.
end Prj.Part; end Prj.Part;
...@@ -143,9 +143,6 @@ package body Prj is ...@@ -143,9 +143,6 @@ package body Prj is
Objects_Path_File_Without_Libs => No_Path, Objects_Path_File_Without_Libs => No_Path,
Config_File_Name => No_Path, Config_File_Name => No_Path,
Config_File_Temp => False, Config_File_Temp => False,
Linker_Name => No_File,
Linker_Path => No_Path,
Minimum_Linker_Options => No_Name_List,
Config_Checked => False, Config_Checked => False,
Checked => False, Checked => False,
Seen => False, Seen => False,
...@@ -1155,29 +1152,6 @@ package body Prj is ...@@ -1155,29 +1152,6 @@ package body Prj is
return Extend_Name (Source_File_Name, Switches_Dependency_Suffix); return Extend_Name (Source_File_Name, Switches_Dependency_Suffix);
end Switches_Name; end Switches_Name;
---------------------------
-- There_Are_Ada_Sources --
---------------------------
function There_Are_Ada_Sources
(In_Tree : Project_Tree_Ref;
Project : Project_Id) return Boolean
is
Prj : Project_Id;
begin
Prj := Project;
while Prj /= No_Project loop
if In_Tree.Projects.Table (Prj).Ada_Sources /= Nil_String then
return True;
end if;
Prj := In_Tree.Projects.Table (Prj).Extends;
end loop;
return False;
end There_Are_Ada_Sources;
----------- -----------
-- Value -- -- Value --
----------- -----------
......
...@@ -1289,20 +1289,6 @@ package Prj is ...@@ -1289,20 +1289,6 @@ package Prj is
-- use this field directly outside of the project manager, use -- use this field directly outside of the project manager, use
-- Prj.Env.Ada_Include_Path instead. -- Prj.Env.Ada_Include_Path instead.
-------------
-- Linking --
-------------
Linker_Name : File_Name_Type := No_File;
-- Value of attribute Language_Processing'Linker in the project file
Linker_Path : Path_Name_Type := No_Path;
-- Path of linker when attribute Language_Processing'Linker is specified
Minimum_Linker_Options : Name_List_Index := No_Name_List;
-- List of options specified in attribute
-- Language_Processing'Minimum_Linker_Options.
------------------- -------------------
-- Miscellaneous -- -- Miscellaneous --
------------------- -------------------
...@@ -1372,12 +1358,6 @@ package Prj is ...@@ -1372,12 +1358,6 @@ package Prj is
-- Return True when Language_Name (which must be lower case) is one of the -- Return True when Language_Name (which must be lower case) is one of the
-- languages used for the project. -- languages used for the project.
function There_Are_Ada_Sources
(In_Tree : Project_Tree_Ref;
Project : Project_Id) return Boolean;
-- ??? needs comment
-- ??? Name sounds strange, suggested replacement: Ada_Sources_Present
Project_Error : exception; Project_Error : exception;
-- Raised by some subprograms in Prj.Attr -- Raised by some subprograms in Prj.Attr
......
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