summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-ext.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-17 10:38:31 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-17 10:38:31 +0000
commit7ac0f4a57adbba6fd8e68bb4619055459b1f6f9f (patch)
tree49238d52872cb62ea7b3b2ed01b0bb7f1bcb4397 /gcc/ada/prj-ext.adb
parent84ec5566784efbac633966ca76a31eca3160dcc0 (diff)
downloadgcc-7ac0f4a57adbba6fd8e68bb4619055459b1f6f9f.tar.gz
2009-09-17 Bob Duff <duff@adacore.com>
* gnat_rm.texi, s-oscons-tmplt.c: Minor typo 2009-09-17 Emmanuel Briot <briot@adacore.com> * gnatcmd.adb, prj-proc.adb, make.adb, prj-ext.adb, prj-ext.ads, makeutl.adb, makeutl.ads, clean.adb, prj-pars.adb, prj-pars.ads, prj-conf.adb, prj-conf.ads, prj-tree.adb, prj-tree.ads, prj-proc.ads, prj-nmsc.ads (Add, Value_Of, Reset): new parameter Tree. Scenario variables are now specific to each project tree loaded in memory. Code clean ups. 2009-09-17 Javier Miranda <miranda@adacore.com> * exp_disp.adb (Make_DT): Remove wrong line of code that was undocumented and probably added by mistake. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151792 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-ext.adb')
-rw-r--r--gcc/ada/prj-ext.adb43
1 files changed, 18 insertions, 25 deletions
diff --git a/gcc/ada/prj-ext.adb b/gcc/ada/prj-ext.adb
index 8098a3a23b1..8bdc1101719 100644
--- a/gcc/ada/prj-ext.adb
+++ b/gcc/ada/prj-ext.adb
@@ -26,11 +26,10 @@
with Hostparm;
with Makeutl; use Makeutl;
with Osint; use Osint;
+with Prj.Tree; use Prj.Tree;
with Sdefault;
with Table;
-with GNAT.HTable;
-
package body Prj.Ext is
Ada_Project_Path : constant String := "ADA_PROJECT_PATH";
@@ -52,19 +51,6 @@ package body Prj.Ext is
procedure Initialize_Project_Path;
-- Initialize Current_Project_Path
- package Htable is new GNAT.HTable.Simple_HTable
- (Header_Num => Header_Num,
- Element => Name_Id,
- No_Element => No_Name,
- Key => Name_Id,
- Hash => Hash,
- Equal => "=");
- -- External references are stored in this hash table, either by procedure
- -- Add (directly or through a call to function Check) or by function
- -- Value_Of when an environment variable is found non empty. Value_Of
- -- first for external reference in this table, before checking the
- -- environment. Htable is emptied (reset) by procedure Reset.
-
package Search_Directories is new Table.Table
(Table_Component_Type => Name_Id,
Table_Index_Type => Natural,
@@ -79,7 +65,8 @@ package body Prj.Ext is
---------
procedure Add
- (External_Name : String;
+ (Tree : Prj.Tree.Project_Node_Tree_Ref;
+ External_Name : String;
Value : String)
is
The_Key : Name_Id;
@@ -92,7 +79,7 @@ package body Prj.Ext is
Name_Buffer (1 .. Name_Len) := External_Name;
Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
The_Key := Name_Find;
- Htable.Set (The_Key, The_Value);
+ Name_To_Name_HTable.Set (Tree.External_References, The_Key, The_Value);
end Add;
-----------
@@ -110,16 +97,19 @@ package body Prj.Ext is
-- Check --
-----------
- function Check (Declaration : String) return Boolean is
+ function Check
+ (Tree : Prj.Tree.Project_Node_Tree_Ref;
+ Declaration : String) return Boolean is
begin
for Equal_Pos in Declaration'Range loop
if Declaration (Equal_Pos) = '=' then
exit when Equal_Pos = Declaration'First;
exit when Equal_Pos = Declaration'Last;
Add
- (External_Name =>
+ (Tree => Tree,
+ External_Name =>
Declaration (Declaration'First .. Equal_Pos - 1),
- Value =>
+ Value =>
Declaration (Equal_Pos + 1 .. Declaration'Last));
return True;
end if;
@@ -294,9 +284,9 @@ package body Prj.Ext is
-- Reset --
-----------
- procedure Reset is
+ procedure Reset (Tree : Prj.Tree.Project_Node_Tree_Ref) is
begin
- Htable.Reset;
+ Name_To_Name_HTable.Reset (Tree.External_References);
end Reset;
----------------------
@@ -314,7 +304,8 @@ package body Prj.Ext is
--------------
function Value_Of
- (External_Name : Name_Id;
+ (Tree : Prj.Tree.Project_Node_Tree_Ref;
+ External_Name : Name_Id;
With_Default : Name_Id := No_Name)
return Name_Id
is
@@ -325,7 +316,8 @@ package body Prj.Ext is
Canonical_Case_File_Name (Name);
Name_Len := Name'Length;
Name_Buffer (1 .. Name_Len) := Name;
- The_Value := Htable.Get (Name_Find);
+ The_Value :=
+ Name_To_Name_HTable.Get (Tree.External_References, Name_Find);
if The_Value /= No_Name then
return The_Value;
@@ -341,7 +333,8 @@ package body Prj.Ext is
Name_Len := Env_Value'Length;
Name_Buffer (1 .. Name_Len) := Env_Value.all;
The_Value := Name_Find;
- Htable.Set (External_Name, The_Value);
+ Name_To_Name_HTable.Set
+ (Tree.External_References, External_Name, The_Value);
Free (Env_Value);
return The_Value;