aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Obry <obry@adacore.com>2013-01-29 14:32:36 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2013-01-29 15:32:36 +0100
commit4e3da85af1403ed3599404bd154c1afc0d3e4b13 (patch)
treea96e34322ddab35b63d14b859cfb9a1bce5acd21
parent7096a67be07002e51b3fecaf0e5972172b717878 (diff)
downloadgcc-4e3da85af1403ed3599404bd154c1afc0d3e4b13.zip
gcc-4e3da85af1403ed3599404bd154c1afc0d3e4b13.tar.gz
gcc-4e3da85af1403ed3599404bd154c1afc0d3e4b13.tar.bz2
prj-proc.adb (Process_Expression_Variable_Decl): Prepend Project_Path to current environment.
2013-01-29 Pascal Obry <obry@adacore.com> * prj-proc.adb (Process_Expression_Variable_Decl): Prepend Project_Path to current environment. From-SVN: r195545
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/prj-env.adb2
-rw-r--r--gcc/ada/prj-proc.adb32
3 files changed, 28 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f23c566..1680a52 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-29 Pascal Obry <obry@adacore.com>
+
+ * prj-proc.adb (Process_Expression_Variable_Decl): Prepend
+ Project_Path to current environment.
+
2013-01-29 Thomas Quinot <quinot@adacore.com>
* sprint.adb (Sprint_Node_Actual): Output freeze nodes for
diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb
index d4bda03..4788fbe 100644
--- a/gcc/ada/prj-env.adb
+++ b/gcc/ada/prj-env.adb
@@ -2188,7 +2188,7 @@ package body Prj.Env is
function Try_Path_Name is new Find_Name_In_Path
(Check_Filename => Is_Regular_File);
- -- Find a file in the project search path.
+ -- Find a file in the project search path
-- Local Declarations
diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb
index e997d17..5e2828b 100644
--- a/gcc/ada/prj-proc.adb
+++ b/gcc/ada/prj-proc.adb
@@ -33,11 +33,12 @@ with Prj.Env;
with Prj.Err; use Prj.Err;
with Prj.Ext; use Prj.Ext;
with Prj.Nmsc; use Prj.Nmsc;
-with Prj.Util;
with Prj.Part;
+with Prj.Util;
with Snames;
-with Ada.Strings.Fixed; use Ada.Strings.Fixed;
+with Ada.Containers.Vectors;
+with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with GNAT.Case_Util; use GNAT.Case_Util;
with GNAT.HTable;
@@ -2062,19 +2063,30 @@ package body Prj.Proc is
if Is_Attribute and then Name = Snames.Name_Project_Path then
if In_Tree.Is_Root_Tree then
declare
- Val : String_List_Id := New_Value.Values;
+ package Name_Ids is
+ new Ada.Containers.Vectors (Positive, Name_Id);
+ Val : String_List_Id := New_Value.Values;
+ List : Name_Ids.Vector;
begin
+ -- Get all values
+
while Val /= Nil_String loop
+ List.Prepend
+ (Shared.String_Elements.Table (Val).Value);
+ Val := Shared.String_Elements.Table (Val).Next;
+ end loop;
+
+ -- Prepend them in the oder found in the attribute
+
+ for K in Positive range 1 .. Positive (List.Length) loop
Prj.Env.Add_Directories
(Child_Env.Project_Path,
Normalize_Pathname
- (Name =>
- Get_Name_String
- (Shared.String_Elements.Table (Val).Value),
- Directory =>
- Get_Name_String
- (Project.Directory.Display_Name)));
- Val := Shared.String_Elements.Table (Val).Next;
+ (Name => Get_Name_String
+ (List.Element (K)),
+ Directory => Get_Name_String
+ (Project.Directory.Display_Name)),
+ Prepend => True);
end loop;
end;