diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 10:34:43 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 10:34:43 +0000 |
commit | f4e3ef7d8fa106f3408ec3fbc1f73ffa781fc2f6 (patch) | |
tree | 834744c75cd321ac555760daef581f47b6f7b4c1 /gcc/ada/prj.adb | |
parent | 8d1e3745fc7dcd77f68e7e3841209bb73e284aa6 (diff) | |
download | gcc-f4e3ef7d8fa106f3408ec3fbc1f73ffa781fc2f6.tar.gz |
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
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154774 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj.adb')
-rw-r--r-- | gcc/ada/prj.adb | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index d42e7117cd5..d097c1dbd6a 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. |