prj.adb (Compute_All_Imported_Projects): Use new For_Project_And_Aggregated_Context to ensure proper context is used for...

2012-02-08  Pascal Obry  <obry@adacore.com>

	* prj.adb (Compute_All_Imported_Projects): Use new
	For_Project_And_Aggregated_Context to ensure proper context is
	used for encapsulated aggregate libraries.
	* prj-proc.adb (Recursive_Process): Call
	Process_Aggregated_Projects earlier to ensure that all dependent
	projects are set with the proper encapsulated status.

2012-02-08  Pascal Obry  <obry@adacore.com>

	* s-os_lib.adb (Normalize_Arguments): Properly escape last \ in null
	terminated string.

From-SVN: r183999
This commit is contained in:
Pascal Obry 2012-02-08 09:31:12 +00:00 committed by Arnaud Charlet
parent 8364925760
commit 75685ef74d
4 changed files with 42 additions and 11 deletions

View File

@ -1,3 +1,17 @@
2012-02-08 Pascal Obry <obry@adacore.com>
* prj.adb (Compute_All_Imported_Projects): Use new
For_Project_And_Aggregated_Context to ensure proper context is
used for encapsulated aggregate libraries.
* prj-proc.adb (Recursive_Process): Call
Process_Aggregated_Projects earlier to ensure that all dependent
projects are set with the proper encapsulated status.
2012-02-08 Pascal Obry <obry@adacore.com>
* s-os_lib.adb (Normalize_Arguments): Properly escape last \ in null
terminated string.
2012-02-08 Pascal Obry <obry@adacore.com>
* prj.ads, prj.adb (For_Project_And_Aggregated_Context): New

View File

@ -2908,6 +2908,10 @@ package body Prj.Proc is
Process_Imported_Projects (Imported, Limited_With => True);
if Err_Vars.Total_Errors_Detected = 0 then
Process_Aggregated_Projects;
end if;
-- At this point (after Process_Declarative_Items) we have the
-- attribute values set, we can backtrace In_Tree.Project and
-- set the From_Encapsulated_Library status.
@ -2935,7 +2939,6 @@ package body Prj.Proc is
end if;
if Err_Vars.Total_Errors_Detected = 0 then
Process_Aggregated_Projects;
-- For an aggregate library we add the aggregated projects
-- as imported ones. This is necessary to give visibility

View File

@ -1476,7 +1476,8 @@ package body Prj is
is
procedure Analyze_Tree
(Local_Root : Project_Id;
Local_Tree : Project_Tree_Ref);
Local_Tree : Project_Tree_Ref;
Context : Project_Context);
-- Process Project and all its aggregated project to analyze their own
-- imported projects.
@ -1486,7 +1487,8 @@ package body Prj is
procedure Analyze_Tree
(Local_Root : Project_Id;
Local_Tree : Project_Tree_Ref)
Local_Tree : Project_Tree_Ref;
Context : Project_Context)
is
pragma Unreferenced (Local_Root);
@ -1540,7 +1542,9 @@ package body Prj is
Project.All_Imported_Projects :=
new Project_List_Element'
(Project => Prj2,
From_Encapsulated_Lib => Context.From_Encapsulated_Lib,
From_Encapsulated_Lib =>
Context.From_Encapsulated_Lib
or else Analyze_Tree.Context.From_Encapsulated_Lib,
Next => Project.All_Imported_Projects);
end if;
end Recursive_Add;
@ -1564,7 +1568,7 @@ package body Prj is
end Analyze_Tree;
procedure For_Aggregates is
new For_Project_And_Aggregated (Analyze_Tree);
new For_Project_And_Aggregated_Context (Analyze_Tree);
-- Start of processing for Compute_All_Imported_Projects

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1995-2010, AdaCore --
-- Copyright (C) 1995-2012, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@ -31,12 +31,12 @@
pragma Compiler_Unit;
with System.Case_Util;
with System.CRTL;
with System.Soft_Links;
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
with System; use System;
with System.Case_Util;
with System.CRTL;
with System.Soft_Links;
package body System.OS_Lib is
@ -1703,6 +1703,16 @@ package body System.OS_Lib is
-- If null terminated string, put the quote before
if Res (J) = ASCII.NUL then
-- If the string ends with \, double it
if Res (J - 1) = '\' then
Res (J) := '\';
J := J + 1;
end if;
-- Then adds the quote and the NUL character
Res (J) := '"';
J := J + 1;
Res (J) := ASCII.NUL;
@ -2131,8 +2141,8 @@ package body System.OS_Lib is
Start := Last;
loop
Start := Start - 1;
exit when Start < 1 or else
Path_Buffer (Start) = Directory_Separator;
exit when Start < 1
or else Path_Buffer (Start) = Directory_Separator;
end loop;
if Start <= 1 then