diff options
author | Vincent Celier <celier@adacore.com> | 2008-07-31 14:37:42 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-07-31 14:37:42 +0200 |
commit | ca311c9fa5a945158921d0c6e59d39ad7b6bbd51 (patch) | |
tree | 111f450ff499447e2cacdf94ccfe431bde98835a | |
parent | 58fda84daa95719faf5305ad44f09816d1de280a (diff) | |
download | gcc-ca311c9fa5a945158921d0c6e59d39ad7b6bbd51.zip gcc-ca311c9fa5a945158921d0c6e59d39ad7b6bbd51.tar.gz gcc-ca311c9fa5a945158921d0c6e59d39ad7b6bbd51.tar.bz2 |
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
-rw-r--r-- | gcc/ada/prj-env.adb | 34 | ||||
-rw-r--r-- | gcc/ada/prj-part.adb | 24 | ||||
-rw-r--r-- | gcc/ada/prj-part.ads | 26 | ||||
-rw-r--r-- | gcc/ada/prj.adb | 26 | ||||
-rw-r--r-- | gcc/ada/prj.ads | 20 |
5 files changed, 52 insertions, 78 deletions
diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb index dd52f35..041a5e3 100644 --- a/gcc/ada/prj-env.adb +++ b/gcc/ada/prj-env.adb @@ -2355,16 +2355,36 @@ package body Prj.Env is -- For a non-library project, add the object -- directory, if it is not a virtual project, and if - -- there are Ada sources or if the project is an - -- extending project. If there are no Ada sources, + -- there are Ada sources in the project or one of the + -- projects it extends. If there are no Ada sources, -- adding the object directory could disrupt the order -- of the object dirs in the path. - elsif not Data.Virtual - and then There_Are_Ada_Sources (In_Tree, Project) - then - Add_To_Object_Path - (Data.Object_Directory.Name, In_Tree); + elsif not Data.Virtual then + declare + Add_Object_Dir : Boolean := False; + Prj : Project_Id := Project; + + 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; diff --git a/gcc/ada/prj-part.adb b/gcc/ada/prj-part.adb index 67c9133..901875a 100644 --- a/gcc/ada/prj-part.adb +++ b/gcc/ada/prj-part.adb @@ -149,6 +149,30 @@ package body Prj.Part is -- does not (because it is already extended), but other projects that it -- 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 (In_Tree : Project_Node_Tree_Ref; Context_Clause : out With_Id); diff --git a/gcc/ada/prj-part.ads b/gcc/ada/prj-part.ads index 8e366bc..e1c69c5 100644 --- a/gcc/ada/prj-part.ads +++ b/gcc/ada/prj-part.ads @@ -6,7 +6,7 @@ -- -- -- 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 -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -49,28 +49,4 @@ package Prj.Part is -- Current_Directory is used for optimization purposes only, avoiding extra -- 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; diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index 4499b0a..23623f5 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -143,9 +143,6 @@ package body Prj is Objects_Path_File_Without_Libs => No_Path, Config_File_Name => No_Path, Config_File_Temp => False, - Linker_Name => No_File, - Linker_Path => No_Path, - Minimum_Linker_Options => No_Name_List, Config_Checked => False, Checked => False, Seen => False, @@ -1155,29 +1152,6 @@ package body Prj is return Extend_Name (Source_File_Name, Switches_Dependency_Suffix); 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 -- ----------- diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index c315c8e..9af43b3 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -1289,20 +1289,6 @@ package Prj is -- use this field directly outside of the project manager, use -- 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 -- ------------------- @@ -1372,12 +1358,6 @@ package Prj is -- Return True when Language_Name (which must be lower case) is one of the -- 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; -- Raised by some subprograms in Prj.Attr |