summaryrefslogtreecommitdiffstats
path: root/gcc/ada/prj-tree.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-03 09:30:45 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-03 09:30:45 +0000
commita6320c6507e6e4491a47bc359082e9e1acc7f66d (patch)
treeed25e8fbaa6ce83df1c7e3fb92cfeaa14e0cc829 /gcc/ada/prj-tree.adb
parent85c0927022511c14eccc3b9984d7b750922dedbc (diff)
downloadppe42-gcc-a6320c6507e6e4491a47bc359082e9e1acc7f66d.tar.gz
ppe42-gcc-a6320c6507e6e4491a47bc359082e9e1acc7f66d.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177247 138bc75d-0d04-0410-961f-82ee72b054a4
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 6fdb02e64aa..6fa56ce975d 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;
-------------------------------
OpenPOWER on IntegriCloud