aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-11-30 11:34:43 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2009-11-30 11:34:43 +0100
commit636e3cb6f9e28933f19599a16b663881f9e7669e (patch)
tree834744c75cd321ac555760daef581f47b6f7b4c1 /gcc/ada/prj.adb
parente64e5f7438497707a97da41a07ca787e04d5f311 (diff)
downloadgcc-636e3cb6f9e28933f19599a16b663881f9e7669e.zip
gcc-636e3cb6f9e28933f19599a16b663881f9e7669e.tar.gz
gcc-636e3cb6f9e28933f19599a16b663881f9e7669e.tar.bz2
[multiple changes]
2009-11-30 Robert Dewar <dewar@adacore.com> * s-stchop-vxworks.adb: Add comment. 2009-11-30 Emmanuel Briot <briot@adacore.com> * make.adb, prj.adb, prj.ads (Compute_All_Imported_Projects): Now acts on the whole tree, to better share code with gprbuild. (Length): New subprogram, to share code in gprbuild. (Project_Data): Remove fields that are only needed when compiling a project in gprbuild (where we use local variables instead) * osint.adb, osint.ads: Added minor comment on memory management From-SVN: r154774
Diffstat (limited to 'gcc/ada/prj.adb')
-rw-r--r--gcc/ada/prj.adb36
1 files changed, 28 insertions, 8 deletions
diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb
index d42e711..d097c1d 100644
--- a/gcc/ada/prj.adb
+++ b/gcc/ada/prj.adb
@@ -86,8 +86,6 @@ package body Prj is
Libgnarl_Needed => Unknown,
Symbol_Data => No_Symbols,
Interfaces_Defined => False,
- Include_Path => null,
- Include_Data_Set => False,
Source_Dirs => Nil_String,
Source_Dir_Ranks => No_Number_List,
Object_Directory => No_Path_Information,
@@ -98,12 +96,11 @@ package body Prj is
Languages => No_Language_Index,
Decl => No_Declarations,
Imported_Projects => null,
+ Include_Path_File => No_Path,
All_Imported_Projects => null,
Ada_Include_Path => null,
- Imported_Directories_Switches => null,
Ada_Objects_Path => null,
Objects_Path => null,
- Include_Path_File => No_Path,
Objects_Path_File_With_Libs => No_Path,
Objects_Path_File_Without_Libs => No_Path,
Config_File_Name => No_Path,
@@ -704,7 +701,6 @@ package body Prj is
begin
if Project /= null then
- Free (Project.Include_Path);
Free (Project.Ada_Include_Path);
Free (Project.Objects_Path);
Free (Project.Ada_Objects_Path);
@@ -1055,7 +1051,8 @@ package body Prj is
-- Compute_All_Imported_Projects --
-----------------------------------
- procedure Compute_All_Imported_Projects (Project : Project_Id) is
+ procedure Compute_All_Imported_Projects (Tree : Project_Tree_Ref) is
+ Project : Project_Id;
procedure Recursive_Add (Prj : Project_Id; Dummy : in out Boolean);
-- Recursively add the projects imported by project Project, but not
@@ -1103,10 +1100,16 @@ package body Prj is
new For_Every_Project_Imported (Boolean, Recursive_Add);
Dummy : Boolean := False;
+ List : Project_List;
begin
- Free_List (Project.All_Imported_Projects, Free_Project => False);
- For_All_Projects (Project, Dummy);
+ List := Tree.Projects;
+ while List /= null loop
+ Project := List.Project;
+ Free_List (Project.All_Imported_Projects, Free_Project => False);
+ For_All_Projects (Project, Dummy);
+ List := List.Next;
+ end loop;
end Compute_All_Imported_Projects;
-------------------
@@ -1207,6 +1210,23 @@ package body Prj is
Require_Obj_Dirs => Require_Obj_Dirs);
end Create_Flags;
+ ------------
+ -- Length --
+ ------------
+
+ function Length
+ (Table : Name_List_Table.Instance; List : Name_List_Index) return Natural
+ is
+ Count : Natural := 0;
+ Tmp : Name_List_Index := List;
+ begin
+ while Tmp /= No_Name_List loop
+ Count := Count + 1;
+ Tmp := Table.Table (Tmp).Next;
+ end loop;
+ return Count;
+ end Length;
+
begin
-- Make sure that the standard config and user project file extensions are
-- compatible with canonical case file naming.