diff options
author | Emmanuel Briot <briot@adacore.com> | 2011-08-04 07:40:11 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-04 09:40:11 +0200 |
commit | 9434c32ec698e22420295be3bccf9d2c91967859 (patch) | |
tree | 56a55f4942d4f4a85a6b029b84a890a9d39fd8de /gcc/ada/prj.adb | |
parent | 6eb9142a253d5b28caa2e6230b5de5d07d4d52f1 (diff) | |
download | gcc-9434c32ec698e22420295be3bccf9d2c91967859.zip gcc-9434c32ec698e22420295be3bccf9d2c91967859.tar.gz gcc-9434c32ec698e22420295be3bccf9d2c91967859.tar.bz2 |
2011-08-04 Emmanuel Briot <briot@adacore.com>
* prj.adb, prj.ads, makeutl.adb, makeutl.ads, prj-env.adb
(Project_Tree_Appdata): New type.
It is now possible to associate application-specific data to a project
tree. In particular, this is used in the gprbuild builder to avoid a
number of global tables and htables, especially now that there can be
several project trees loaded at once because of aggregate projects.
(Debug_Name): new procedure.
* projects.texi: Clarify syntax of "**" for Source_Dirs
From-SVN: r177315
Diffstat (limited to 'gcc/ada/prj.adb')
-rw-r--r-- | gcc/ada/prj.adb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index 7640bcf..05163c3 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -943,6 +943,8 @@ package body Prj is procedure Free (Tree : in out Project_Tree_Ref) is procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Project_Tree_Data, Project_Tree_Ref); + procedure Unchecked_Free is new Ada.Unchecked_Deallocation + (Project_Tree_Appdata'Class, Project_Tree_Appdata_Access); begin if Tree /= null then @@ -957,6 +959,11 @@ package body Prj is Temp_Files_Table.Free (Tree.Shared.Private_Part.Temp_Files); end if; + if Tree.Appdata /= null then + Free (Tree.Appdata.all); + Unchecked_Free (Tree.Appdata); + end if; + Source_Paths_Htable.Reset (Tree.Source_Paths_HT); Source_Files_Htable.Reset (Tree.Source_Files_HT); @@ -1466,6 +1473,41 @@ package body Prj is end if; end Debug_Decrease_Indent; + ---------------- + -- Debug_Name -- + ---------------- + + function Debug_Name (Tree : Project_Tree_Ref) return Name_Id is + P : Project_List := Tree.Projects; + begin + Name_Len := 0; + Add_Str_To_Name_Buffer ("Tree ["); + + while P /= null loop + if P /= Tree.Projects then + Add_Char_To_Name_Buffer (','); + end if; + + Add_Str_To_Name_Buffer (Get_Name_String (P.Project.Name)); + + P := P.Next; + end loop; + + Add_Char_To_Name_Buffer (']'); + + return Name_Find; + end Debug_Name; + + ---------- + -- Free -- + ---------- + + procedure Free (Tree : in out Project_Tree_Appdata) is + pragma Unreferenced (Tree); + begin + null; + end Free; + begin -- Make sure that the standard config and user project file extensions are -- compatible with canonical case file naming. |