aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj-tree.adb
diff options
context:
space:
mode:
authorEmmanuel Briot <briot@adacore.com>2011-08-03 09:30:45 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 11:30:45 +0200
commit804fe3c4e68b9ab02f60ee33acfc325cfda76591 (patch)
treeed25e8fbaa6ce83df1c7e3fb92cfeaa14e0cc829 /gcc/ada/prj-tree.adb
parentc565bc662885e6499424f898701924445d62c2f7 (diff)
downloadgcc-804fe3c4e68b9ab02f60ee33acfc325cfda76591.zip
gcc-804fe3c4e68b9ab02f60ee33acfc325cfda76591.tar.gz
gcc-804fe3c4e68b9ab02f60ee33acfc325cfda76591.tar.bz2
prj-proc.adb, [...] (Environment): new type.
2011-08-03 Emmanuel Briot <briot@adacore.com> * prj-proc.adb, prj.ads, makeutl.adb, makeutl.ads, prj-conf.adb, prj-tree.adb, prj-tree.ads (Environment): new type. From-SVN: r177247
Diffstat (limited to 'gcc/ada/prj-tree.adb')
-rw-r--r--gcc/ada/prj-tree.adb31
1 files changed, 26 insertions, 5 deletions
diff --git a/gcc/ada/prj-tree.adb b/gcc/ada/prj-tree.adb
index 6fdb02e..6fa56ce 100644
--- a/gcc/ada/prj-tree.adb
+++ b/gcc/ada/prj-tree.adb
@@ -982,17 +982,26 @@ package body Prj.Tree is
-- Initialize --
----------------
- procedure Initialize (Tree : Project_Node_Tree_Ref) is
+ procedure Initialize
+ (Tree : Project_Node_Tree_Ref; Env : in out Environment) is
begin
Project_Node_Table.Init (Tree.Project_Nodes);
Projects_Htable.Reset (Tree.Projects_HT);
+ Initialize (Env);
+ end Initialize;
+ ----------------
+ -- Initialize --
+ ----------------
+
+ procedure Initialize (Self : in out Environment) is
+ begin
-- Do not reset the external references, in case we are reloading a
-- project, since we want to preserve the current environment.
-- But we still need to ensure that the external references are properly
-- initialized.
- Prj.Ext.Initialize (Tree.External);
+ Prj.Ext.Initialize (Self.External);
-- Prj.Ext.Reset (Tree.External);
end Initialize;
@@ -1000,17 +1009,29 @@ package body Prj.Tree is
-- Free --
----------
- procedure Free (Proj : in out Project_Node_Tree_Ref) is
+ procedure Free (Self : in out Environment) is
+ begin
+ Prj.Ext.Free (Self.External);
+ Free (Self.Project_Path);
+ end Free;
+
+ ----------
+ -- Free --
+ ----------
+
+ procedure Free
+ (Proj : in out Project_Node_Tree_Ref;
+ Env : in out Environment)
+ is
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Project_Node_Tree_Data, Project_Node_Tree_Ref);
begin
if Proj /= null then
Project_Node_Table.Free (Proj.Project_Nodes);
Projects_Htable.Reset (Proj.Projects_HT);
- Prj.Ext.Free (Proj.External);
- Free (Proj.Project_Path);
Unchecked_Free (Proj);
end if;
+ Free (Env);
end Free;
-------------------------------