From 75685ef74d410e993ed35c43ac76a56f00b4ddaf Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Wed, 8 Feb 2012 09:31:12 +0000 Subject: [PATCH] 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 * 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 * s-os_lib.adb (Normalize_Arguments): Properly escape last \ in null terminated string. From-SVN: r183999 --- gcc/ada/ChangeLog | 14 ++++++++++++++ gcc/ada/prj-proc.adb | 5 ++++- gcc/ada/prj.adb | 12 ++++++++---- gcc/ada/s-os_lib.adb | 22 ++++++++++++++++------ 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 76ff4fb23fc..4d0daf49753 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,17 @@ +2012-02-08 Pascal Obry + + * 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 + + * s-os_lib.adb (Normalize_Arguments): Properly escape last \ in null + terminated string. + 2012-02-08 Pascal Obry * prj.ads, prj.adb (For_Project_And_Aggregated_Context): New diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index e22c6abda20..1d5c7738e52 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -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 diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index 15cb808f0d1..f9cc7398cc0 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -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 diff --git a/gcc/ada/s-os_lib.adb b/gcc/ada/s-os_lib.adb index 9a07bbb8008..993cc8c5959 100755 --- a/gcc/ada/s-os_lib.adb +++ b/gcc/ada/s-os_lib.adb @@ -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 -- 2.30.2