Commit 2f1e0b61 by Emmanuel Briot Committed by Arnaud Charlet

make.adb, [...] (Create_Mapping_File): merge the two versions for Ada_Only and…

make.adb, [...] (Create_Mapping_File): merge the two versions for Ada_Only and Multi_Language modes...

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

	* make.adb, prj-env.adb, prj-env.ads, prj-nmsc.adb, prj.adb,
	prj.ads (Create_Mapping_File): merge the two versions for Ada_Only and
	Multi_Language modes, to avoid code duplication.
	(Project_Data.Include_Language): Removed.

From-SVN: r146586
parent 35afb012
2009-04-22 Emmanuel Briot <briot@adacore.com>
* make.adb, prj-env.adb, prj-env.ads, prj-nmsc.adb, prj.adb,
prj.ads (Create_Mapping_File): merge the two versions for Ada_Only and
Multi_Language modes, to avoid code duplication.
(Project_Data.Include_Language): Removed.
2009-04-22 Vincent Celier <celier@adacore.com> 2009-04-22 Vincent Celier <celier@adacore.com>
* tempdir.adb (Create_Temp_File): Add a diagnostic in verbose mode when * tempdir.adb (Create_Temp_File): Add a diagnostic in verbose mode when
......
...@@ -6380,7 +6380,7 @@ package body Make is ...@@ -6380,7 +6380,7 @@ package body Make is
Library_Paths.Table (Index).all); Library_Paths.Table (Index).all);
end loop; end loop;
-- One switch for the standard GNAT library dir. -- One switch for the standard GNAT library dir
Linker_Switches.Increment_Last; Linker_Switches.Increment_Last;
Linker_Switches.Table Linker_Switches.Table
...@@ -6809,9 +6809,11 @@ package body Make is ...@@ -6809,9 +6809,11 @@ package body Make is
if Project /= No_Project then if Project /= No_Project then
Prj.Env.Create_Mapping_File Prj.Env.Create_Mapping_File
(Project, Project_Tree, (Project,
The_Mapping_File_Names In_Tree => Project_Tree,
(Project, Last_Mapping_File_Names (Project))); Language => No_Name,
Name => The_Mapping_File_Names
(Project, Last_Mapping_File_Names (Project)));
-- Otherwise, just create an empty file -- Otherwise, just create an empty file
......
...@@ -41,30 +41,27 @@ package Prj.Env is ...@@ -41,30 +41,27 @@ package Prj.Env is
-- corresponding to a source. -- corresponding to a source.
procedure Create_Mapping_File procedure Create_Mapping_File
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
Name : out Path_Name_Type);
-- Create a temporary mapping file for project Project. For each unit
-- in the closure of immediate sources of Project, put the mapping of
-- its spec and or body to its file name and path name in this file.
procedure Create_Mapping_File
(Project : Project_Id; (Project : Project_Id;
Language : Name_Id; Language : Name_Id := No_Name;
In_Tree : Project_Tree_Ref; In_Tree : Project_Tree_Ref;
Name : out Path_Name_Type); Name : out Path_Name_Type);
-- Create a temporary mapping file for project Project. For each source or -- Create a temporary mapping file for project Project. For each source or
-- template of Language in the Project, put the mapping of its file -- template of Language in the Project, put the mapping of its file
-- name and path name in this file. -- name and path name in this file.
-- --
-- This function either looks at all the source files for the specified
-- language in the project, or if Language is set to No_Name, at all
-- units in the project.
--
-- Implementation note: we pass a language name, not a language_index here, -- Implementation note: we pass a language name, not a language_index here,
-- since the latter would have to match exactly the index of that language -- since the latter would have to match exactly the index of that language
-- for the specified project, and that is not information available in -- for the specified project, and that is not information available in
-- buildgpr.adb -- buildgpr.adb.
procedure Set_Mapping_File_Initial_State_To_Empty; procedure Set_Mapping_File_Initial_State_To_Empty;
-- When creating a mapping file, create an empty map. This case occurs -- When creating a mapping file, create an empty map. This case occurs when
-- when run time source files are found in the project files. -- run time source files are found in the project files. This only applies
-- to the Ada_Only mode.
procedure Create_Config_Pragmas_File procedure Create_Config_Pragmas_File
(For_Project : Project_Id; (For_Project : Project_Id;
...@@ -97,11 +94,11 @@ package Prj.Env is ...@@ -97,11 +94,11 @@ package Prj.Env is
(Project : Project_Id; (Project : Project_Id;
In_Tree : Project_Tree_Ref; In_Tree : Project_Tree_Ref;
Recursive : Boolean) return String; Recursive : Boolean) return String;
-- Get the source search path of a Project file. If Recursive it True, -- Get the source search path of a Project file. If Recursive it True, get
-- get all the source directories of the imported and modified project -- all the source directories of the imported and modified project files
-- files (recursively). If Recursive is False, just get the path for the -- (recursively). If Recursive is False, just get the path for the source
-- source directories of Project. Note: the resulting String may be empty -- directories of Project. Note: the resulting String may be empty if there
-- if there is no source directory in the project file. -- is no source directory in the project file.
function Ada_Objects_Path function Ada_Objects_Path
(Project : Project_Id; (Project : Project_Id;
...@@ -115,18 +112,17 @@ package Prj.Env is ...@@ -115,18 +112,17 @@ package Prj.Env is
(Project : Project_Id; (Project : Project_Id;
In_Tree : Project_Tree_Ref; In_Tree : Project_Tree_Ref;
Including_Libraries : Boolean); Including_Libraries : Boolean);
-- Set the env vars for additional project path files, after -- Set the environment variables for additional project path files, after
-- creating the path files if necessary. -- creating the path files if necessary.
procedure Delete_All_Path_Files (In_Tree : Project_Tree_Ref); procedure Delete_All_Path_Files (In_Tree : Project_Tree_Ref);
-- Delete all temporary path files that have been created by -- Delete all temporary path files that have been created by Set_Ada_Paths
-- calls to Set_Ada_Paths.
function Path_Name_Of_Library_Unit_Body function Path_Name_Of_Library_Unit_Body
(Name : String; (Name : String;
Project : Project_Id; Project : Project_Id;
In_Tree : Project_Tree_Ref) return String; In_Tree : Project_Tree_Ref) return String;
-- Returns the Path of a library unit -- Returns the path of a library unit
function File_Name_Of_Library_Unit_Body function File_Name_Of_Library_Unit_Body
(Name : String; (Name : String;
...@@ -169,8 +165,8 @@ package Prj.Env is ...@@ -169,8 +165,8 @@ package Prj.Env is
procedure For_All_Source_Dirs procedure For_All_Source_Dirs
(Project : Project_Id; (Project : Project_Id;
In_Tree : Project_Tree_Ref); In_Tree : Project_Tree_Ref);
-- Iterate through all the source directories of a project, including -- Iterate through all the source directories of a project, including those
-- those of imported or modified projects. -- of imported or modified projects.
generic generic
with procedure Action (Path : String); with procedure Action (Path : String);
......
...@@ -72,9 +72,10 @@ package body Prj.Nmsc is ...@@ -72,9 +72,10 @@ package body Prj.Nmsc is
Except : Boolean := False; Except : Boolean := False;
Found : Boolean := False; Found : Boolean := False;
end record; end record;
-- Information about file names found in string list attribute -- Information about file names found in string list attribute:
-- Source_Files or in a source list file, stored in hash table -- Source_Files or in a source list file, stored in hash table.
-- Source_Names, used by procedure Get_Path_Names_And_Record_Sources. -- Source_Names, used by procedure Get_Path_Names_And_Record_Sources.
-- Except is set to True if source is a naming exception in the project.
No_Name_Location : constant Name_Location := No_Name_Location : constant Name_Location :=
(Name => No_File, (Name => No_File,
...@@ -3264,7 +3265,7 @@ package body Prj.Nmsc is ...@@ -3264,7 +3265,7 @@ package body Prj.Nmsc is
Write_Attr ("Body_Suffix", Get_Name_String (Body_Suffix)); Write_Attr ("Body_Suffix", Get_Name_String (Body_Suffix));
-- We'll need the dot replacement below, so compute it now. -- We'll need the dot replacement below, so compute it now
Check_Common Check_Common
(Dot_Replacement => Data.Naming.Dot_Replacement, (Dot_Replacement => Data.Naming.Dot_Replacement,
......
...@@ -116,7 +116,6 @@ package body Prj is ...@@ -116,7 +116,6 @@ package body Prj is
Imported_Directories_Switches => null, Imported_Directories_Switches => null,
Include_Path => null, Include_Path => null,
Include_Data_Set => False, Include_Data_Set => False,
Include_Language => No_Language_Index,
Source_Dirs => Nil_String, Source_Dirs => Nil_String,
Known_Order_Of_Source_Dirs => True, Known_Order_Of_Source_Dirs => True,
Object_Directory => No_Path_Information, Object_Directory => No_Path_Information,
......
...@@ -1178,8 +1178,6 @@ package Prj is ...@@ -1178,8 +1178,6 @@ package Prj is
-- The list of languages of the sources of this project -- The list of languages of the sources of this project
-- mode: Ada_Only -- mode: Ada_Only
Include_Language : Language_Index := No_Language_Index;
First_Language_Processing : Language_Index := No_Language_Index; First_Language_Processing : Language_Index := No_Language_Index;
-- First index of the language data in the project. -- First index of the language data in the project.
-- This is an index into the project_tree_data.languages_data -- This is an index into the project_tree_data.languages_data
......
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