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>
* tempdir.adb (Create_Temp_File): Add a diagnostic in verbose mode when
......
......@@ -6380,7 +6380,7 @@ package body Make is
Library_Paths.Table (Index).all);
end loop;
-- One switch for the standard GNAT library dir.
-- One switch for the standard GNAT library dir
Linker_Switches.Increment_Last;
Linker_Switches.Table
......@@ -6809,9 +6809,11 @@ package body Make is
if Project /= No_Project then
Prj.Env.Create_Mapping_File
(Project, Project_Tree,
The_Mapping_File_Names
(Project, Last_Mapping_File_Names (Project)));
(Project,
In_Tree => Project_Tree,
Language => No_Name,
Name => The_Mapping_File_Names
(Project, Last_Mapping_File_Names (Project)));
-- Otherwise, just create an empty file
......
......@@ -41,30 +41,27 @@ package Prj.Env is
-- corresponding to a source.
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;
Language : Name_Id;
Language : Name_Id := No_Name;
In_Tree : Project_Tree_Ref;
Name : out Path_Name_Type);
-- Create a temporary mapping file for project Project. For each source or
-- template of Language in the Project, put the mapping of its 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,
-- since the latter would have to match exactly the index of that language
-- for the specified project, and that is not information available in
-- buildgpr.adb
-- buildgpr.adb.
procedure Set_Mapping_File_Initial_State_To_Empty;
-- When creating a mapping file, create an empty map. This case occurs
-- when run time source files are found in the project files.
-- When creating a mapping file, create an empty map. This case occurs when
-- run time source files are found in the project files. This only applies
-- to the Ada_Only mode.
procedure Create_Config_Pragmas_File
(For_Project : Project_Id;
......@@ -97,11 +94,11 @@ package Prj.Env is
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
Recursive : Boolean) return String;
-- Get the source search path of a Project file. If Recursive it True,
-- get all the source directories of the imported and modified project
-- files (recursively). If Recursive is False, just get the path for the
-- source directories of Project. Note: the resulting String may be empty
-- if there is no source directory in the project file.
-- Get the source search path of a Project file. If Recursive it True, get
-- all the source directories of the imported and modified project files
-- (recursively). If Recursive is False, just get the path for the source
-- directories of Project. Note: the resulting String may be empty if there
-- is no source directory in the project file.
function Ada_Objects_Path
(Project : Project_Id;
......@@ -115,18 +112,17 @@ package Prj.Env is
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
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.
procedure Delete_All_Path_Files (In_Tree : Project_Tree_Ref);
-- Delete all temporary path files that have been created by
-- calls to Set_Ada_Paths.
-- Delete all temporary path files that have been created by Set_Ada_Paths
function Path_Name_Of_Library_Unit_Body
(Name : String;
Project : Project_Id;
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
(Name : String;
......@@ -169,8 +165,8 @@ package Prj.Env is
procedure For_All_Source_Dirs
(Project : Project_Id;
In_Tree : Project_Tree_Ref);
-- Iterate through all the source directories of a project, including
-- those of imported or modified projects.
-- Iterate through all the source directories of a project, including those
-- of imported or modified projects.
generic
with procedure Action (Path : String);
......
......@@ -72,9 +72,10 @@ package body Prj.Nmsc is
Except : Boolean := False;
Found : Boolean := False;
end record;
-- Information about file names found in string list attribute
-- Source_Files or in a source list file, stored in hash table
-- Information about file names found in string list attribute:
-- Source_Files or in a source list file, stored in hash table.
-- 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 :=
(Name => No_File,
......@@ -3264,7 +3265,7 @@ package body Prj.Nmsc is
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
(Dot_Replacement => Data.Naming.Dot_Replacement,
......
......@@ -116,7 +116,6 @@ package body Prj is
Imported_Directories_Switches => null,
Include_Path => null,
Include_Data_Set => False,
Include_Language => No_Language_Index,
Source_Dirs => Nil_String,
Known_Order_Of_Source_Dirs => True,
Object_Directory => No_Path_Information,
......
......@@ -1178,8 +1178,6 @@ package Prj is
-- The list of languages of the sources of this project
-- mode: Ada_Only
Include_Language : Language_Index := No_Language_Index;
First_Language_Processing : Language_Index := No_Language_Index;
-- First index of the language data in the project.
-- 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