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.ads | |
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.ads')
-rw-r--r-- | gcc/ada/prj.ads | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index 578faf2..4d8e470 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -1437,6 +1437,17 @@ package Prj is -- own tree) and make the comparison of projects easier, all trees store -- the lists in the same tables. + type Project_Tree_Appdata is tagged null record; + type Project_Tree_Appdata_Access is access all Project_Tree_Appdata'Class; + -- Application-specific data that can be associated with a project tree. + -- We do not make the Project_Tree_Data itself tagged for several reasons: + -- - it couldn't have a default value for its discriminant + -- - it would require a "factory" to allocate such data, because trees + -- are created automatically when parsing aggregate projects. + + procedure Free (Tree : in out Project_Tree_Appdata); + -- Should be overridden if your derive your own data + type Project_Tree_Data (Is_Root_Tree : Boolean := True) is record -- The root tree is the one loaded by the user from the command line. -- Is_Root_Tree is only false for projects aggregated within a root @@ -1472,6 +1483,9 @@ package Prj is Shared : Shared_Project_Tree_Data_Access; -- The shared data for this tree and all aggregated trees. + Appdata : Project_Tree_Appdata_Access; + -- Application-specific data for this tree + case Is_Root_Tree is when True => Shared_Data : aliased Shared_Project_Tree_Data; @@ -1483,6 +1497,10 @@ package Prj is end record; -- Data for a project tree + function Debug_Name (Tree : Project_Tree_Ref) return Name_Id; + -- If debug traces are activated, return an identitier for the + -- project tree. This modifies Name_Buffer + procedure Expect (The_Token : Token_Type; Token_Image : String); -- Check that the current token is The_Token. If it is not, then output -- an error message. |