Commit 8b9890fa by Emmanuel Briot Committed by Arnaud Charlet

prj-proc.adb, [...] (Project_Data.Seen): field removed.

2009-04-24  Emmanuel Briot  <briot@adacore.com>

	* prj-proc.adb, make.adb, mlib-prj.adb, prj.adb, prj.ads, makeutl.adb,
	clean.adb, prj-nmsc.adb, prj-env.adb, prj-env.ads (Project_Data.Seen):
	field removed. This is not a property of the
	project, just a boolean used to traverse the project tree, and storing
	it in the structure prevents doing multiple traversal in parallel.
	(Project_Data.Checked): also removed, since it was playing the same role
	as Seen when we had two nested loops, and this is no longer necessary
	(For_All_Imported_Projects): removed, since in fact there was already
	the equivalent in For_Every_Project_Imported. The latter was rewritten
	to use a local hash table instead of Project_Data.Seen
	Various loops were rewritten to use For_Every_Project_Imported, thus
	removing the need for Project_Data.Seen. This avoids a lot of code
	duplication

From-SVN: r146699
parent 76e776e5
2009-04-24 Emmanuel Briot <briot@adacore.com>
* prj-proc.adb, make.adb, mlib-prj.adb, prj.adb, prj.ads, makeutl.adb,
clean.adb, prj-nmsc.adb, prj-env.adb, prj-env.ads (Project_Data.Seen):
field removed. This is not a property of the
project, just a boolean used to traverse the project tree, and storing
it in the structure prevents doing multiple traversal in parallel.
(Project_Data.Checked): also removed, since it was playing the same role
as Seen when we had two nested loops, and this is no longer necessary
(For_All_Imported_Projects): removed, since in fact there was already
the equivalent in For_Every_Project_Imported. The latter was rewritten
to use a local hash table instead of Project_Data.Seen
Various loops were rewritten to use For_Every_Project_Imported, thus
removing the need for Project_Data.Seen. This avoids a lot of code
duplication
2009-04-24 Ed Schonberg <schonberg@adacore.com> 2009-04-24 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve_Actuals): Do not create blocks around code * sem_res.adb (Resolve_Actuals): Do not create blocks around code
......
...@@ -878,7 +878,7 @@ package body Clean is ...@@ -878,7 +878,7 @@ package body Clean is
-- Source_Dirs or Source_Files is specified as an empty list, -- Source_Dirs or Source_Files is specified as an empty list,
-- so always look for Ada units in extending projects. -- so always look for Ada units in extending projects.
if Data.Ada_Sources_Present if Has_Ada_Sources (Data)
or else Data.Extends /= No_Project or else Data.Extends /= No_Project
then then
for Unit in Unit_Table.First .. for Unit in Unit_Table.First ..
...@@ -1028,8 +1028,8 @@ package body Clean is ...@@ -1028,8 +1028,8 @@ package body Clean is
for Proj in Project_Table.First .. for Proj in Project_Table.First ..
Project_Table.Last (Project_Tree.Projects) Project_Table.Last (Project_Tree.Projects)
loop loop
if Project_Tree.Projects.Table if Has_Foreign_Sources
(Proj).Other_Sources_Present (Project_Tree.Projects.Table (Proj))
then then
Global_Archive := True; Global_Archive := True;
exit; exit;
......
...@@ -587,15 +587,9 @@ package body Make is ...@@ -587,15 +587,9 @@ package body Make is
procedure Debug_Msg (S : String; N : Unit_Name_Type); procedure Debug_Msg (S : String; N : Unit_Name_Type);
-- If Debug.Debug_Flag_W is set outputs string S followed by name N -- If Debug.Debug_Flag_W is set outputs string S followed by name N
procedure Recursive_Compute_Depth procedure Recursive_Compute_Depth (Project : Project_Id);
(Project : Project_Id;
Depth : Natural);
-- Compute depth of Project and of the projects it depends on -- Compute depth of Project and of the projects it depends on
procedure Compute_All_Imported_Projects (Project : Project_Id);
-- Compute, the list of the projects imported directly or indirectly by
-- project Project.
----------------------- -----------------------
-- Gnatmake Routines -- -- Gnatmake Routines --
----------------------- -----------------------
...@@ -3717,95 +3711,6 @@ package body Make is ...@@ -3717,95 +3711,6 @@ package body Make is
end if; end if;
end Compile_Sources; end Compile_Sources;
-----------------------------------
-- Compute_All_Imported_Projects --
-----------------------------------
procedure Compute_All_Imported_Projects (Project : Project_Id) is
procedure Add_To_List (Prj : Project_Id);
-- Add a project to the list All_Imported_Projects of project Project
procedure Recursive_Add_Imported (Project : Project_Id);
-- Recursively add the projects imported by project Project, but not
-- those that are extended.
-----------------
-- Add_To_List --
-----------------
procedure Add_To_List (Prj : Project_Id) is
Element : constant Project_Element :=
(Prj, Project_Tree.Projects.Table (Project).All_Imported_Projects);
List : Project_List;
begin
Project_List_Table.Increment_Last (Project_Tree.Project_Lists);
List := Project_List_Table.Last (Project_Tree.Project_Lists);
Project_Tree.Project_Lists.Table (List) := Element;
Project_Tree.Projects.Table (Project).All_Imported_Projects := List;
end Add_To_List;
----------------------------
-- Recursive_Add_Imported --
----------------------------
procedure Recursive_Add_Imported (Project : Project_Id) is
List : Project_List;
Element : Project_Element;
Prj : Project_Id;
begin
if Project /= No_Project then
-- For all the imported projects
List := Project_Tree.Projects.Table (Project).Imported_Projects;
while List /= Empty_Project_List loop
Element := Project_Tree.Project_Lists.Table (List);
Prj := Element.Project;
-- Get the ultimate extending project
while
Project_Tree.Projects.Table (Prj).Extended_By /= No_Project
loop
Prj := Project_Tree.Projects.Table (Prj).Extended_By;
end loop;
-- If project has not yet been visited, add to list and recurse
if not Project_Tree.Projects.Table (Prj).Seen then
Project_Tree.Projects.Table (Prj).Seen := True;
Add_To_List (Prj);
Recursive_Add_Imported (Prj);
end if;
List := Element.Next;
end loop;
-- Recurse on projects being imported, if any
Recursive_Add_Imported
(Project_Tree.Projects.Table (Project).Extends);
end if;
end Recursive_Add_Imported;
begin
-- Reset the Seen flag for all projects
for Index in 1 .. Project_Table.Last (Project_Tree.Projects) loop
Project_Tree.Projects.Table (Index).Seen := False;
end loop;
-- Make sure the list is empty
Project_Tree.Projects.Table (Project).All_Imported_Projects :=
Empty_Project_List;
-- Add to the list all projects imported directly or indirectly
Recursive_Add_Imported (Project);
end Compute_All_Imported_Projects;
---------------------------------- ----------------------------------
-- Configuration_Pragmas_Switch -- -- Configuration_Pragmas_Switch --
---------------------------------- ----------------------------------
...@@ -7065,16 +6970,7 @@ package body Make is ...@@ -7065,16 +6970,7 @@ package body Make is
Add_Source_Directories (Main_Project, Project_Tree); Add_Source_Directories (Main_Project, Project_Tree);
Add_Object_Directories (Main_Project, Project_Tree); Add_Object_Directories (Main_Project, Project_Tree);
-- Compute depth of each project Recursive_Compute_Depth (Main_Project);
for Proj in Project_Table.First ..
Project_Table.Last (Project_Tree.Projects)
loop
Project_Tree.Projects.Table (Proj).Seen := False;
Project_Tree.Projects.Table (Proj).Depth := 0;
end loop;
Recursive_Compute_Depth (Main_Project, Depth => 1);
-- For each project compute the list of the projects it imports -- For each project compute the list of the projects it imports
-- directly or indirectly. -- directly or indirectly.
...@@ -7082,7 +6978,7 @@ package body Make is ...@@ -7082,7 +6978,7 @@ package body Make is
for Proj in Project_Table.First .. for Proj in Project_Table.First ..
Project_Table.Last (Project_Tree.Projects) Project_Table.Last (Project_Tree.Projects)
loop loop
Compute_All_Imported_Projects (Proj); Compute_All_Imported_Projects (Proj, Project_Tree);
end loop; end loop;
else else
...@@ -7632,51 +7528,56 @@ package body Make is ...@@ -7632,51 +7528,56 @@ package body Make is
-- Recursive_Compute_Depth -- -- Recursive_Compute_Depth --
----------------------------- -----------------------------
procedure Recursive_Compute_Depth procedure Recursive_Compute_Depth (Project : Project_Id) is
(Project : Project_Id; use Project_Boolean_Htable;
Depth : Natural) Seen : Project_Boolean_Htable.Instance := Project_Boolean_Htable.Nil;
is
List : Project_List;
Proj : Project_Id;
begin procedure Recurse (Prj : Project_Id; Depth : Natural);
-- Nothing to do if there is no project or if the project has already
-- been seen or if the depth is large enough.
if Project = No_Project procedure Recurse (Prj : Project_Id; Depth : Natural) is
or else Project_Tree.Projects.Table (Project).Seen Data : Project_Data renames Project_Tree.Projects.Table (Prj);
or else Project_Tree.Projects.Table (Project).Depth >= Depth List : Project_List;
then Proj : Project_Id;
return; begin
end if; if Data.Depth >= Depth
or Get (Seen, Prj)
then
return;
end if;
Project_Tree.Projects.Table (Project).Depth := Depth; -- We need a test to avoid infinite recursions with limited withs:
-- If we have A -> B -> A, then when set level of A to n, we try and
-- set level of B to n+1, and then level of A to n + 2,...
-- Mark project as Seen to avoid endless loop caused by limited withs Set (Seen, Prj, True);
Project_Tree.Projects.Table (Project).Seen := True; Data.Depth := Depth;
List := Project_Tree.Projects.Table (Project).Imported_Projects; List := Data.Imported_Projects;
-- Visit each imported project -- Visit each imported project
while List /= Empty_Project_List loop while List /= Empty_Project_List loop
Proj := Project_Tree.Project_Lists.Table (List).Project; Proj := Project_Tree.Project_Lists.Table (List).Project;
List := Project_Tree.Project_Lists.Table (List).Next; List := Project_Tree.Project_Lists.Table (List).Next;
Recursive_Compute_Depth Recurse (Prj => Proj, Depth => Depth + 1);
(Project => Proj, end loop;
Depth => Depth + 1);
end loop;
-- Visit a project being extended, if any -- We again allow changing the depth of this project later on if it
-- is in fact imported by a lower-level project.
Recursive_Compute_Depth Set (Seen, Prj, False);
(Project => Project_Tree.Projects.Table (Project).Extends, end Recurse;
Depth => Depth + 1);
-- Reset the Seen flag, as we leave this project begin
for Proj in Project_Table.First ..
Project_Table.Last (Project_Tree.Projects)
loop
Project_Tree.Projects.Table (Proj).Depth := 0;
end loop;
Project_Tree.Projects.Table (Project).Seen := False; Recurse (Project, Depth => 1);
Reset (Seen);
end Recursive_Compute_Depth; end Recursive_Compute_Depth;
------------------------------- -------------------------------
......
...@@ -364,74 +364,53 @@ package body Makeutl is ...@@ -364,74 +364,53 @@ package body Makeutl is
(Project : Project_Id; (Project : Project_Id;
In_Tree : Project_Tree_Ref) return String_List In_Tree : Project_Tree_Ref) return String_List
is is
procedure Recursive_Add_Linker_Options (Proj : Project_Id); procedure Recursive_Add (Proj : Project_Id; Dummy : in out Boolean);
-- The recursive routine used to add linker options -- The recursive routine used to add linker options
---------------------------------- -------------------
-- Recursive_Add_Linker_Options -- -- Recursive_Add --
---------------------------------- -------------------
procedure Recursive_Add_Linker_Options (Proj : Project_Id) is procedure Recursive_Add (Proj : Project_Id; Dummy : in out Boolean) is
Data : Project_Data; pragma Unreferenced (Dummy);
Data : Project_Data renames In_Tree.Projects.Table (Proj);
Linker_Package : Package_Id; Linker_Package : Package_Id;
Options : Variable_Value; Options : Variable_Value;
Imported : Project_List;
begin begin
if Proj /= No_Project then Linker_Package :=
Data := In_Tree.Projects.Table (Proj); Prj.Util.Value_Of
(Name => Name_Linker,
if not Data.Seen then In_Packages => Data.Decl.Packages,
In_Tree.Projects.Table (Proj).Seen := True; In_Tree => In_Tree);
Imported := Data.Imported_Projects; Options :=
Prj.Util.Value_Of
while Imported /= Empty_Project_List loop (Name => Name_Ada,
Recursive_Add_Linker_Options Index => 0,
(In_Tree.Project_Lists.Table Attribute_Or_Array_Name => Name_Linker_Options,
(Imported).Project); In_Package => Linker_Package,
Imported := In_Tree.Project_Lists.Table In_Tree => In_Tree);
(Imported).Next;
end loop; -- If attribute is present, add the project with
-- the attribute to table Linker_Opts.
if Proj /= Project then
Linker_Package := if Options /= Nil_Variable_Value then
Prj.Util.Value_Of Linker_Opts.Increment_Last;
(Name => Name_Linker, Linker_Opts.Table (Linker_Opts.Last) :=
In_Packages => Data.Decl.Packages, (Project => Proj, Options => Options.Values);
In_Tree => In_Tree);
Options :=
Prj.Util.Value_Of
(Name => Name_Ada,
Index => 0,
Attribute_Or_Array_Name => Name_Linker_Options,
In_Package => Linker_Package,
In_Tree => In_Tree);
-- If attribute is present, add the project with
-- the attribute to table Linker_Opts.
if Options /= Nil_Variable_Value then
Linker_Opts.Increment_Last;
Linker_Opts.Table (Linker_Opts.Last) :=
(Project => Proj, Options => Options.Values);
end if;
end if;
end if;
end if; end if;
end Recursive_Add_Linker_Options; end Recursive_Add;
procedure For_All_Projects is
new For_Every_Project_Imported (Boolean, Recursive_Add);
Dummy : Boolean := False;
-- Start of processing for Linker_Options_Switches -- Start of processing for Linker_Options_Switches
begin begin
Linker_Opts.Init; Linker_Opts.Init;
for Index in Project_Table.First .. For_All_Projects (Project, In_Tree, Dummy);
Project_Table.Last (In_Tree.Projects)
loop
In_Tree.Projects.Table (Index).Seen := False;
end loop;
Recursive_Add_Linker_Options (Project);
Last_Linker_Option := 0; Last_Linker_Option := 0;
...@@ -449,8 +428,7 @@ package body Makeutl is ...@@ -449,8 +428,7 @@ package body Makeutl is
In_Tree.Projects.Table (Proj).Dir_Path := In_Tree.Projects.Table (Proj).Dir_Path :=
new String' new String'
(Get_Name_String (Get_Name_String
(In_Tree.Projects.Table (In_Tree.Projects.Table (Proj).Directory.Name));
(Proj).Directory.Name));
end if; end if;
while Options /= Nil_String loop while Options /= Nil_String loop
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2001-2008, AdaCore -- -- Copyright (C) 2001-2009, AdaCore --
-- -- -- --
-- 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- --
......
...@@ -172,11 +172,4 @@ package Prj.Env is ...@@ -172,11 +172,4 @@ package Prj.Env is
-- Iterate through all the object directories of a project, including -- Iterate through all the object directories of a project, including
-- those of imported or modified projects. -- those of imported or modified projects.
generic
with procedure Action (Project : Project_Id);
procedure For_All_Imported_Projects
(Project : Project_Id;
In_Tree : Project_Tree_Ref);
-- Execute Action for Project and all imported or extended projects
end Prj.Env; end Prj.Env;
...@@ -5445,7 +5445,7 @@ package body Prj.Nmsc is ...@@ -5445,7 +5445,7 @@ package body Prj.Nmsc is
Read (Dir, Name_Buffer, Name_Len); Read (Dir, Name_Buffer, Name_Len);
if Current_Verbosity = High then if Current_Verbosity = High then
Write_Str (" Checking "); Write_Str (" Checking ");
Write_Line (Name_Buffer (1 .. Name_Len)); Write_Line (Name_Buffer (1 .. Name_Len));
end if; end if;
...@@ -6450,7 +6450,7 @@ package body Prj.Nmsc is ...@@ -6450,7 +6450,7 @@ package body Prj.Nmsc is
if Last = Filename'Last then if Last = Filename'Last then
if Current_Verbosity = High then if Current_Verbosity = High then
Write_Line (" No matching suffix"); Write_Line (" No matching suffix");
end if; end if;
return; return;
end if; end if;
...@@ -6602,9 +6602,9 @@ package body Prj.Nmsc is ...@@ -6602,9 +6602,9 @@ package body Prj.Nmsc is
and then Current_Verbosity = High and then Current_Verbosity = High
then then
case Kind is case Kind is
when Spec => Write_Str (" spec of "); when Spec => Write_Str (" spec of ");
when Impl => Write_Str (" body of "); when Impl => Write_Str (" body of ");
when Sep => Write_Str (" sep of "); when Sep => Write_Str (" sep of ");
end case; end case;
Write_Line (Get_Name_String (Unit)); Write_Line (Get_Name_String (Unit));
...@@ -8456,7 +8456,7 @@ package body Prj.Nmsc is ...@@ -8456,7 +8456,7 @@ package body Prj.Nmsc is
begin begin
if Current_Verbosity = High then if Current_Verbosity = High then
Write_Str ("Putting "); Write_Str (" Putting ");
Write_Str (Get_Name_String (Unit_Name)); Write_Str (Get_Name_String (Unit_Name));
Write_Line (" in the unit list."); Write_Line (" in the unit list.");
end if; end if;
......
...@@ -141,16 +141,19 @@ package body Prj.Proc is ...@@ -141,16 +141,19 @@ package body Prj.Proc is
-- recursively for all imported projects and a extended project, if any. -- recursively for all imported projects and a extended project, if any.
-- Then process the declarative items of the project. -- Then process the declarative items of the project.
procedure Recursive_Check type Recursive_Check_Data is record
(Project : Project_Id;
In_Tree : Project_Tree_Ref; In_Tree : Project_Tree_Ref;
Current_Dir : String; Current_Dir : String_Access;
When_No_Sources : Error_Warning); When_No_Sources : Error_Warning;
-- If Project is not marked as checked, mark it as checked, call end record;
-- Check_Naming_Scheme for the project, then call itself for a -- Data passed to Recursive_Check
-- possible extended project and all the imported projects of Project.
-- Current_Dir is for optimization purposes, avoiding extra system calls. -- Current_Dir is for optimization purposes, avoiding extra system calls.
procedure Recursive_Check
(Project : Project_Id;
Data : in out Recursive_Check_Data);
-- Check_Naming_Scheme for the project
--------- ---------
-- Add -- -- Add --
--------- ---------
...@@ -274,16 +277,14 @@ package body Prj.Proc is ...@@ -274,16 +277,14 @@ package body Prj.Proc is
Current_Dir : String; Current_Dir : String;
When_No_Sources : Error_Warning) When_No_Sources : Error_Warning)
is is
begin Dir : aliased String := Current_Dir;
-- Make sure that all projects are marked as not checked
for Index in Project_Table.First .. procedure Check_All_Projects is new
Project_Table.Last (In_Tree.Projects) For_Every_Project_Imported (Recursive_Check_Data, Recursive_Check);
loop Data : Recursive_Check_Data :=
In_Tree.Projects.Table (Index).Checked := False; (In_Tree, Dir'Unchecked_Access, When_No_Sources);
end loop; begin
Check_All_Projects (Project, In_Tree, Data, Imported_First => True);
Recursive_Check (Project, In_Tree, Current_Dir, When_No_Sources);
-- Set the Other_Part field for the units -- Set the Other_Part field for the units
...@@ -2461,55 +2462,19 @@ package body Prj.Proc is ...@@ -2461,55 +2462,19 @@ package body Prj.Proc is
procedure Recursive_Check procedure Recursive_Check
(Project : Project_Id; (Project : Project_Id;
In_Tree : Project_Tree_Ref; Data : in out Recursive_Check_Data)
Current_Dir : String;
When_No_Sources : Error_Warning)
is is
Data : Project_Data;
Imported_Project_List : Project_List := Empty_Project_List;
begin begin
-- Do nothing if Project is No_Project, or Project has already if Verbose_Mode then
-- been marked as checked. Write_Str ("Checking project file """);
Write_Str
if Project /= No_Project (Get_Name_String (Data.In_Tree.Projects.Table (Project).Name));
and then not In_Tree.Projects.Table (Project).Checked Write_Line ("""");
then
-- Mark project as checked, to avoid infinite recursion in
-- ill-formed trees, where a project imports itself.
In_Tree.Projects.Table (Project).Checked := True;
Data := In_Tree.Projects.Table (Project);
-- Call itself for a possible extended project.
-- (if there is no extended project, then nothing happens).
Recursive_Check (Data.Extends, In_Tree, Current_Dir, When_No_Sources);
-- Call itself for all imported projects
Imported_Project_List := Data.Imported_Projects;
while Imported_Project_List /= Empty_Project_List loop
Recursive_Check
(In_Tree.Project_Lists.Table
(Imported_Project_List).Project,
In_Tree, Current_Dir, When_No_Sources);
Imported_Project_List :=
In_Tree.Project_Lists.Table
(Imported_Project_List).Next;
end loop;
if Verbose_Mode then
Write_Str ("Checking project file """);
Write_Str (Get_Name_String (Data.Name));
Write_Line ("""");
end if;
Prj.Nmsc.Check
(Project, In_Tree, Error_Report, When_No_Sources,
Current_Dir);
end if; end if;
Prj.Nmsc.Check
(Project, Data.In_Tree, Error_Report, Data.When_No_Sources,
Data.Current_Dir.all);
end Recursive_Check; end Recursive_Check;
----------------------- -----------------------
......
...@@ -906,6 +906,29 @@ package Prj is ...@@ -906,6 +906,29 @@ package Prj is
Naming : in out Naming_Data; Naming : in out Naming_Data;
Suffix : File_Name_Type); Suffix : File_Name_Type);
function Get_Object_Directory
(In_Tree : Project_Tree_Ref;
Project : Project_Id;
Including_Libraries : Boolean;
Only_If_Ada : Boolean := False) return Path_Name_Type;
-- Return the object directory to use for the project. This depends on
-- whether we have a library project or a standard project. This function
-- might return No_Name when no directory applies.
-- If we have a a library project file and Including_Libraries is True then
-- the library dir is returned instead of the object dir.
-- If Only_If_Ada is True, then No_Name will be returned when the project
-- doesn't Ada sources.
procedure Compute_All_Imported_Projects
(Project : Project_Id; In_Tree : Project_Tree_Ref);
-- Compute, the list of the projects imported directly or indirectly by
-- project Project. The result is stored in Project.All_Imported_Projects
function Ultimate_Extending_Project_Of
(Proj : Project_Id; In_Tree : Project_Tree_Ref) return Project_Id;
-- Returns the ultimate extending project of project Proj. If project Proj
-- is not extended, returns Proj.
function Standard_Naming_Data function Standard_Naming_Data
(Tree : Project_Tree_Ref := No_Project_Tree) return Naming_Data; (Tree : Project_Tree_Ref := No_Project_Tree) return Naming_Data;
pragma Inline (Standard_Naming_Data); pragma Inline (Standard_Naming_Data);
...@@ -1310,14 +1333,6 @@ package Prj is ...@@ -1310,14 +1333,6 @@ package Prj is
Config_Checked : Boolean := False; Config_Checked : Boolean := False;
-- A flag to avoid checking repetitively the configuration pragmas file -- A flag to avoid checking repetitively the configuration pragmas file
Checked : Boolean := False;
-- A flag to avoid checking repetitively the naming scheme of this
-- project file.
Seen : Boolean := False;
-- A flag to mark a project as "visited" to avoid processing the same
-- project several time.
Depth : Natural := 0; Depth : Natural := 0;
-- The maximum depth of a project in the project graph. Depth of main -- The maximum depth of a project in the project graph. Depth of main
-- project is 0. -- project is 0.
...@@ -1496,6 +1511,16 @@ package Prj is ...@@ -1496,6 +1511,16 @@ package Prj is
-- Otherwise, this information will be automatically added to Naming_Data -- Otherwise, this information will be automatically added to Naming_Data
-- when a project is processed, in the lists Spec_Suffix and Body_Suffix. -- when a project is processed, in the lists Spec_Suffix and Body_Suffix.
package Project_Boolean_Htable is new Simple_HTable
(Header_Num => Header_Num,
Element => Boolean,
No_Element => False,
Key => Project_Id,
Hash => Hash,
Equal => "=");
-- A table that associates a project to a boolean. This is used to detect
-- whether a project was already processed for instance.
generic generic
type State is limited private; type State is limited private;
with procedure Action with procedure Action
...@@ -1504,15 +1529,19 @@ package Prj is ...@@ -1504,15 +1529,19 @@ package Prj is
procedure For_Every_Project_Imported procedure For_Every_Project_Imported
(By : Project_Id; (By : Project_Id;
In_Tree : Project_Tree_Ref; In_Tree : Project_Tree_Ref;
With_State : in out State); With_State : in out State;
Imported_First : Boolean := False);
-- Call Action for each project imported directly or indirectly by project -- Call Action for each project imported directly or indirectly by project
-- By. Action is called according to the order of importation: if A -- By, as well as extended projects.
-- The order of processing depends on Imported_First:
-- If False, Action is called according to the order of importation: if A
-- imports B, directly or indirectly, Action will be called for A before -- imports B, directly or indirectly, Action will be called for A before
-- it is called for B. If two projects import each other directly or -- it is called for B. If two projects import each other directly or
-- indirectly (using at least one "limited with"), it is not specified -- indirectly (using at least one "limited with"), it is not specified
-- for which of these two projects Action will be called first. Projects -- for which of these two projects Action will be called first.
-- that are extended by other projects are not considered. With_State may -- The order is reversed if Imported_First is True.
-- be used by Action to choose a behavior or to report some global result. -- With_State may be used by Action to choose a behavior or to report some
-- global result.
function Extend_Name function Extend_Name
(File : File_Name_Type; (File : File_Name_Type;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment