prj-proc.adb (Recursive_Process): Set From_Encapsulated_Lib boolean value to true in the process list created by...
2012-01-30 Pascal Obry <obry@adacore.com> * prj-proc.adb (Recursive_Process): Set From_Encapsulated_Lib boolean value to true in the process list created by this routine. * prj.ads (Project_List_Element): New field From_Encapsulated_Lib. Continued work for KA06-021. * prj.adb (Compute_All_Imported_Projects): Set From_Encapsulated_Lib boolean flag. From-SVN: r183703
This commit is contained in:
parent
457c5df44b
commit
a76b09dce5
|
@ -1,3 +1,12 @@
|
||||||
|
2012-01-30 Pascal Obry <obry@adacore.com>
|
||||||
|
|
||||||
|
* prj-proc.adb (Recursive_Process): Set From_Encapsulated_Lib
|
||||||
|
boolean value to true in the process list created by this routine.
|
||||||
|
* prj.ads (Project_List_Element): New field From_Encapsulated_Lib.
|
||||||
|
Continued work for KA06-021.
|
||||||
|
* prj.adb (Compute_All_Imported_Projects): Set
|
||||||
|
From_Encapsulated_Lib boolean flag.
|
||||||
|
|
||||||
2012-01-30 Vincent Pucci <pucci@adacore.com>
|
2012-01-30 Vincent Pucci <pucci@adacore.com>
|
||||||
|
|
||||||
* sem_dim.adb (Expand_Put_Call_With_Dimension_Symbol): Minor
|
* sem_dim.adb (Expand_Put_Call_With_Dimension_Symbol): Minor
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
-- --
|
-- --
|
||||||
-- B o d y --
|
-- B o d y --
|
||||||
-- --
|
-- --
|
||||||
-- Copyright (C) 2001-2011, Free Software Foundation, Inc. --
|
-- Copyright (C) 2001-2012, Free Software Foundation, Inc. --
|
||||||
-- --
|
-- --
|
||||||
-- GNAT is free software; you can redistribute it and/or modify it under --
|
-- 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- --
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||||
|
@ -32,6 +32,7 @@ with Prj.Env;
|
||||||
with Prj.Err; use Prj.Err;
|
with Prj.Err; use Prj.Err;
|
||||||
with Prj.Ext; use Prj.Ext;
|
with Prj.Ext; use Prj.Ext;
|
||||||
with Prj.Nmsc; use Prj.Nmsc;
|
with Prj.Nmsc; use Prj.Nmsc;
|
||||||
|
with Prj.Util;
|
||||||
with Prj.Part;
|
with Prj.Part;
|
||||||
with Snames;
|
with Snames;
|
||||||
|
|
||||||
|
@ -149,7 +150,8 @@ package body Prj.Proc is
|
||||||
From_Project_Node : Project_Node_Id;
|
From_Project_Node : Project_Node_Id;
|
||||||
From_Project_Node_Tree : Project_Node_Tree_Ref;
|
From_Project_Node_Tree : Project_Node_Tree_Ref;
|
||||||
Env : in out Prj.Tree.Environment;
|
Env : in out Prj.Tree.Environment;
|
||||||
Extended_By : Project_Id);
|
Extended_By : Project_Id;
|
||||||
|
From_Encapsulated_Lib : Boolean);
|
||||||
-- Process project with node From_Project_Node in the tree. Do nothing if
|
-- Process project with node From_Project_Node in the tree. Do nothing if
|
||||||
-- From_Project_Node is Empty_Node. If project has already been processed,
|
-- From_Project_Node is Empty_Node. If project has already been processed,
|
||||||
-- simply return its project id. Otherwise create a new project id, mark it
|
-- simply return its project id. Otherwise create a new project id, mark it
|
||||||
|
@ -161,6 +163,9 @@ package body Prj.Proc is
|
||||||
-- explicitly loaded. In the context of aggregate projects, only that
|
-- explicitly loaded. In the context of aggregate projects, only that
|
||||||
-- project is allowed to modify the environment that will be used to load
|
-- project is allowed to modify the environment that will be used to load
|
||||||
-- projects (Child_Env).
|
-- projects (Child_Env).
|
||||||
|
--
|
||||||
|
-- From_Encapsulated_Lib is true if we are parsing a project from
|
||||||
|
-- encapsulated library dependencies.
|
||||||
|
|
||||||
function Get_Attribute_Index
|
function Get_Attribute_Index
|
||||||
(Tree : Project_Node_Tree_Ref;
|
(Tree : Project_Node_Tree_Ref;
|
||||||
|
@ -2357,7 +2362,8 @@ package body Prj.Proc is
|
||||||
From_Project_Node => From_Project_Node,
|
From_Project_Node => From_Project_Node,
|
||||||
From_Project_Node_Tree => From_Project_Node_Tree,
|
From_Project_Node_Tree => From_Project_Node_Tree,
|
||||||
Env => Env,
|
Env => Env,
|
||||||
Extended_By => No_Project);
|
Extended_By => No_Project,
|
||||||
|
From_Encapsulated_Lib => False);
|
||||||
|
|
||||||
Success :=
|
Success :=
|
||||||
Total_Errors_Detected = 0
|
Total_Errors_Detected = 0
|
||||||
|
@ -2491,7 +2497,8 @@ package body Prj.Proc is
|
||||||
From_Project_Node : Project_Node_Id;
|
From_Project_Node : Project_Node_Id;
|
||||||
From_Project_Node_Tree : Project_Node_Tree_Ref;
|
From_Project_Node_Tree : Project_Node_Tree_Ref;
|
||||||
Env : in out Prj.Tree.Environment;
|
Env : in out Prj.Tree.Environment;
|
||||||
Extended_By : Project_Id)
|
Extended_By : Project_Id;
|
||||||
|
From_Encapsulated_Lib : Boolean)
|
||||||
is
|
is
|
||||||
Shared : constant Shared_Project_Tree_Data_Access := In_Tree.Shared;
|
Shared : constant Shared_Project_Tree_Data_Access := In_Tree.Shared;
|
||||||
|
|
||||||
|
@ -2550,20 +2557,19 @@ package body Prj.Proc is
|
||||||
Project_Node_Of (With_Clause, From_Project_Node_Tree),
|
Project_Node_Of (With_Clause, From_Project_Node_Tree),
|
||||||
From_Project_Node_Tree => From_Project_Node_Tree,
|
From_Project_Node_Tree => From_Project_Node_Tree,
|
||||||
Env => Env,
|
Env => Env,
|
||||||
Extended_By => No_Project);
|
Extended_By => No_Project,
|
||||||
|
From_Encapsulated_Lib => From_Encapsulated_Lib);
|
||||||
-- Imported is the id of the last imported project. If
|
|
||||||
-- it is nil, then this imported project is our first.
|
|
||||||
|
|
||||||
if Imported = null then
|
if Imported = null then
|
||||||
Project.Imported_Projects :=
|
Project.Imported_Projects := new Project_List_Element'
|
||||||
new Project_List_Element'
|
|
||||||
(Project => New_Project,
|
(Project => New_Project,
|
||||||
|
From_Encapsulated_Lib => False,
|
||||||
Next => null);
|
Next => null);
|
||||||
Imported := Project.Imported_Projects;
|
Imported := Project.Imported_Projects;
|
||||||
else
|
else
|
||||||
Imported.Next := new Project_List_Element'
|
Imported.Next := new Project_List_Element'
|
||||||
(Project => New_Project,
|
(Project => New_Project,
|
||||||
|
From_Encapsulated_Lib => False,
|
||||||
Next => null);
|
Next => null);
|
||||||
Imported := Imported.Next;
|
Imported := Imported.Next;
|
||||||
end if;
|
end if;
|
||||||
|
@ -2762,7 +2768,7 @@ package body Prj.Proc is
|
||||||
|
|
||||||
else
|
else
|
||||||
declare
|
declare
|
||||||
Imported : Project_List;
|
Imported, Mark : Project_List;
|
||||||
Declaration_Node : Project_Node_Id := Empty_Node;
|
Declaration_Node : Project_Node_Id := Empty_Node;
|
||||||
|
|
||||||
Name : constant Name_Id :=
|
Name : constant Name_Id :=
|
||||||
|
@ -2795,11 +2801,19 @@ package body Prj.Proc is
|
||||||
(Project_Qualifier_Of
|
(Project_Qualifier_Of
|
||||||
(From_Project_Node, From_Project_Node_Tree)));
|
(From_Project_Node, From_Project_Node_Tree)));
|
||||||
|
|
||||||
|
-- Note that at this point we do not know yet if the project has
|
||||||
|
-- been withed from an encapsulated library or not.
|
||||||
|
|
||||||
In_Tree.Projects :=
|
In_Tree.Projects :=
|
||||||
new Project_List_Element'
|
new Project_List_Element'
|
||||||
(Project => Project,
|
(Project => Project,
|
||||||
|
From_Encapsulated_Lib => False,
|
||||||
Next => In_Tree.Projects);
|
Next => In_Tree.Projects);
|
||||||
|
|
||||||
|
-- Keep track of this point
|
||||||
|
|
||||||
|
Mark := In_Tree.Projects;
|
||||||
|
|
||||||
Processed_Projects.Set (Name, Project);
|
Processed_Projects.Set (Name, Project);
|
||||||
|
|
||||||
Project.Name := Name;
|
Project.Name := Name;
|
||||||
|
@ -2874,7 +2888,8 @@ package body Prj.Proc is
|
||||||
(Declaration_Node, From_Project_Node_Tree),
|
(Declaration_Node, From_Project_Node_Tree),
|
||||||
From_Project_Node_Tree => From_Project_Node_Tree,
|
From_Project_Node_Tree => From_Project_Node_Tree,
|
||||||
Env => Env,
|
Env => Env,
|
||||||
Extended_By => Project);
|
Extended_By => Project,
|
||||||
|
From_Encapsulated_Lib => From_Encapsulated_Lib);
|
||||||
|
|
||||||
Process_Declarative_Items
|
Process_Declarative_Items
|
||||||
(Project => Project,
|
(Project => Project,
|
||||||
|
@ -2893,13 +2908,38 @@ package body Prj.Proc is
|
||||||
|
|
||||||
Process_Imported_Projects (Imported, Limited_With => True);
|
Process_Imported_Projects (Imported, Limited_With => True);
|
||||||
|
|
||||||
|
-- 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.
|
||||||
|
|
||||||
|
declare
|
||||||
|
Lib_Standalone : constant Prj.Variable_Value :=
|
||||||
|
Prj.Util.Value_Of
|
||||||
|
(Snames.Name_Library_Standalone,
|
||||||
|
Project.Decl.Attributes,
|
||||||
|
Shared);
|
||||||
|
List : Project_List := In_Tree.Projects;
|
||||||
|
Is_Encapsulated : Boolean;
|
||||||
|
begin
|
||||||
|
Get_Name_String (Lib_Standalone.Value);
|
||||||
|
To_Lower (Name_Buffer (1 .. Name_Len));
|
||||||
|
|
||||||
|
Is_Encapsulated := Name_Buffer (1 .. Name_Len) = "encapsulated";
|
||||||
|
|
||||||
|
if Is_Encapsulated then
|
||||||
|
while List /= null and then List /= Mark loop
|
||||||
|
List.From_Encapsulated_Lib := Is_Encapsulated;
|
||||||
|
List := List.Next;
|
||||||
|
end loop;
|
||||||
|
end if;
|
||||||
|
|
||||||
if Err_Vars.Total_Errors_Detected = 0 then
|
if Err_Vars.Total_Errors_Detected = 0 then
|
||||||
Process_Aggregated_Projects;
|
Process_Aggregated_Projects;
|
||||||
|
|
||||||
-- For an aggregate library we add the aggregated projects as
|
-- For an aggregate library we add the aggregated projects
|
||||||
-- imported ones. This is necessary to give visibility to all
|
-- as imported ones. This is necessary to give visibility
|
||||||
-- sources from the aggregates from the aggregated library
|
-- to all sources from the aggregates from the aggregated
|
||||||
-- projects.
|
-- library projects.
|
||||||
|
|
||||||
if Project.Qualifier = Aggregate_Library then
|
if Project.Qualifier = Aggregate_Library then
|
||||||
declare
|
declare
|
||||||
|
@ -2910,12 +2950,15 @@ package body Prj.Proc is
|
||||||
Project.Imported_Projects :=
|
Project.Imported_Projects :=
|
||||||
new Project_List_Element'
|
new Project_List_Element'
|
||||||
(Project => L.Project,
|
(Project => L.Project,
|
||||||
Next => Project.Imported_Projects);
|
From_Encapsulated_Lib => Is_Encapsulated,
|
||||||
|
Next =>
|
||||||
|
Project.Imported_Projects);
|
||||||
L := L.Next;
|
L := L.Next;
|
||||||
end loop;
|
end loop;
|
||||||
end;
|
end;
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
|
end;
|
||||||
|
|
||||||
if Project.Qualifier = Aggregate and then In_Tree.Is_Root_Tree then
|
if Project.Qualifier = Aggregate and then In_Tree.Is_Root_Tree then
|
||||||
Free (Child_Env);
|
Free (Child_Env);
|
||||||
|
|
|
@ -1479,6 +1479,7 @@ package body Prj is
|
||||||
procedure Recursive_Add
|
procedure Recursive_Add
|
||||||
(Prj : Project_Id;
|
(Prj : Project_Id;
|
||||||
Tree : Project_Tree_Ref;
|
Tree : Project_Tree_Ref;
|
||||||
|
Context : Project_Context;
|
||||||
Dummy : in out Boolean);
|
Dummy : in out Boolean);
|
||||||
-- Recursively add the projects imported by project Project, but not
|
-- Recursively add the projects imported by project Project, but not
|
||||||
-- those that are extended.
|
-- those that are extended.
|
||||||
|
@ -1490,6 +1491,7 @@ package body Prj is
|
||||||
procedure Recursive_Add
|
procedure Recursive_Add
|
||||||
(Prj : Project_Id;
|
(Prj : Project_Id;
|
||||||
Tree : Project_Tree_Ref;
|
Tree : Project_Tree_Ref;
|
||||||
|
Context : Project_Context;
|
||||||
Dummy : in out Boolean)
|
Dummy : in out Boolean)
|
||||||
is
|
is
|
||||||
pragma Unreferenced (Dummy, Tree);
|
pragma Unreferenced (Dummy, Tree);
|
||||||
|
@ -1522,12 +1524,13 @@ package body Prj is
|
||||||
Project.All_Imported_Projects :=
|
Project.All_Imported_Projects :=
|
||||||
new Project_List_Element'
|
new Project_List_Element'
|
||||||
(Project => Prj2,
|
(Project => Prj2,
|
||||||
|
From_Encapsulated_Lib => Context.From_Encapsulated_Lib,
|
||||||
Next => Project.All_Imported_Projects);
|
Next => Project.All_Imported_Projects);
|
||||||
end if;
|
end if;
|
||||||
end Recursive_Add;
|
end Recursive_Add;
|
||||||
|
|
||||||
procedure For_All_Projects is
|
procedure For_All_Projects is
|
||||||
new For_Every_Project_Imported (Boolean, Recursive_Add);
|
new For_Every_Project_Imported_Context (Boolean, Recursive_Add);
|
||||||
|
|
||||||
Dummy : Boolean := False;
|
Dummy : Boolean := False;
|
||||||
List : Project_List;
|
List : Project_List;
|
||||||
|
|
|
@ -939,6 +939,7 @@ package Prj is
|
||||||
type Project_List is access all Project_List_Element;
|
type Project_List is access all Project_List_Element;
|
||||||
type Project_List_Element is record
|
type Project_List_Element is record
|
||||||
Project : Project_Id := No_Project;
|
Project : Project_Id := No_Project;
|
||||||
|
From_Encapsulated_Lib : Boolean := False;
|
||||||
Next : Project_List := null;
|
Next : Project_List := null;
|
||||||
end record;
|
end record;
|
||||||
-- A list of projects
|
-- A list of projects
|
||||||
|
|
Loading…
Reference in New Issue