prj.adb (Compute_All_Imported_Projects): Use new For_Project_And_Aggregated_Context...
authorPascal Obry <obry@adacore.com>
Wed, 8 Feb 2012 09:31:12 +0000 (09:31 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 8 Feb 2012 09:31:12 +0000 (10:31 +0100)
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

gcc/ada/ChangeLog
gcc/ada/prj-proc.adb
gcc/ada/prj.adb
gcc/ada/s-os_lib.adb

index 76ff4fb23fcd065b0f42490455384e8a08dde407..4d0daf497530e43bdbe2e17b9d4af3709b7c534e 100644 (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
index e22c6abda20ec0387bcf47949593d29a8e41a510..1d5c7738e5205c09b90f150a461ee08a0a7251be 100644 (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
index 15cb808f0d1d7ae32b201a8a0be0053a09540ca1..f9cc7398cc0a1e50990bab6e2631fd6dfe47515d 100644 (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
 
index 9a07bbb800872359027ecf06a9ac8d3aa5df3e79..993cc8c5959305fc3f93bc1bffd8bb885c62f428 100755 (executable)
@@ -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- --
 
 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