diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-04 07:40:11 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-04 07:40:11 +0000 |
commit | 5495b11e65a6d2fcea8606af5586162d3cef5c3f (patch) | |
tree | 56a55f4942d4f4a85a6b029b84a890a9d39fd8de /gcc/ada/prj.ads | |
parent | 1ef7c666411b1f76f047aaf5466ce76c4cf450db (diff) | |
download | gcc-5495b11e65a6d2fcea8606af5586162d3cef5c3f.tar.gz |
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
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177315 138bc75d-0d04-0410-961f-82ee72b054a4
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 578faf2659b..4d8e47030b3 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. |