Commit fadcf313 by Arnaud Charlet

[multiple changes]

2009-06-25  Emmanuel Briot  <briot@adacore.com>

	* gnatcmd.adb, prj-proc.adb, make.adb, prj.adb, prj.ads, prj-nmsc.adb,
	prj-util.adb, prj-env.adb, prj-env.ads: Merge handling of naming_data
	between gnatmake and gprbuild.
	(Naming_Data): Removed, no longer used
	(Naming_Table, Project_Tree_Ref.Namings): Removed, since this is only
	needed locally in one subprogram, no need to store forever in the
	structure.
	(Check_Naming_Scheme, Check_Package_Naming): Merged, since they play
	a similar role.
	(Body_Suffix_Of, Body_Suffix_Id_Of, Register_Default_Naming_Scheme,
	Same_Naming_Scheme, Set_Body_Suffix, Set_Spec_Suffix, Spec_Suffix_Of,
	Spec_Suffix_Id_Of): removed, no longer used.

2009-06-25  Javier Miranda  <miranda@adacore.com>

	* sem_res.adb (Resolve_Allocator): Skip test requiring exact match of
	types on qualified expression in calls to imported C++ constructors.

	* exp_ch4.adb (Expand_Allocator_Expression): Add missing support for
	imported C++ constructors.

2009-06-25  Sergey Rybin  <rybin@adacore.com>

	* vms_data.ads: Add qualifier for new gnatcheck '-t' option.

From-SVN: r148937
parent 5b900a45
2009-06-25 Emmanuel Briot <briot@adacore.com>
* gnatcmd.adb, prj-proc.adb, make.adb, prj.adb, prj.ads, prj-nmsc.adb,
prj-util.adb, prj-env.adb, prj-env.ads: Merge handling of naming_data
between gnatmake and gprbuild.
(Naming_Data): Removed, no longer used
(Naming_Table, Project_Tree_Ref.Namings): Removed, since this is only
needed locally in one subprogram, no need to store forever in the
structure.
(Check_Naming_Scheme, Check_Package_Naming): Merged, since they play
a similar role.
(Body_Suffix_Of, Body_Suffix_Id_Of, Register_Default_Naming_Scheme,
Same_Naming_Scheme, Set_Body_Suffix, Set_Spec_Suffix, Spec_Suffix_Of,
Spec_Suffix_Id_Of): removed, no longer used.
2009-06-25 Javier Miranda <miranda@adacore.com>
* sem_res.adb (Resolve_Allocator): Skip test requiring exact match of
types on qualified expression in calls to imported C++ constructors.
* exp_ch4.adb (Expand_Allocator_Expression): Add missing support for
imported C++ constructors.
2009-06-25 Sergey Rybin <rybin@adacore.com>
* vms_data.ads: Add qualifier for new gnatcheck '-t' option.
2009-06-25 Vincent Celier <celier@adacore.com> 2009-06-25 Vincent Celier <celier@adacore.com>
* s-os_lib.adb (Normalize_Pathname.Get_Directory): If directory * s-os_lib.adb (Normalize_Pathname.Get_Directory): If directory
...@@ -12,6 +39,7 @@ ...@@ -12,6 +39,7 @@
2009-06-25 Quentin Ochem <ochem@adacore.com> 2009-06-25 Quentin Ochem <ochem@adacore.com>
* prj.ads (Unit_Index): Now general access type. * prj.ads (Unit_Index): Now general access type.
2009-06-25 Pascal Obry <obry@adacore.com> 2009-06-25 Pascal Obry <obry@adacore.com>
* a-stwise.adb, a-stzsea.adb: Fix confusion between 'Length and 'Last. * a-stwise.adb, a-stzsea.adb: Fix confusion between 'Length and 'Last.
......
...@@ -572,6 +572,57 @@ package body Exp_Ch4 is ...@@ -572,6 +572,57 @@ package body Exp_Ch4 is
begin begin
if Is_Tagged_Type (T) or else Needs_Finalization (T) then if Is_Tagged_Type (T) or else Needs_Finalization (T) then
if Is_CPP_Constructor_Call (Exp) then
-- Generate:
-- Pnnn : constant ptr_T := new (T); Init (Pnnn.all,...); Pnnn
-- Allocate the object with no expression
Node := Relocate_Node (N);
Set_Expression (Node,
New_Reference_To (Root_Type (Etype (Exp)), Loc));
-- Avoid its expansion to avoid generating a call to the default
-- C++ constructor
Set_Analyzed (Node);
Temp := Make_Defining_Identifier (Loc, New_Internal_Name ('P'));
Insert_Action (N,
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Constant_Present => True,
Object_Definition => New_Reference_To (PtrT, Loc),
Expression => Node));
Apply_Accessibility_Check (Temp);
-- Locate the enclosing list to insert the C++ constructor call
declare
P : Node_Id := Parent (Node);
begin
while not Is_List_Member (P) loop
P := Parent (P);
end loop;
Insert_List_After_And_Analyze (P,
Build_Initialization_Call (Loc,
Id_Ref => Make_Explicit_Dereference (Loc,
New_Reference_To (Temp, Loc)),
Typ => Root_Type (Etype (Exp)),
Constructor_Ref => Exp));
end;
Rewrite (N, New_Reference_To (Temp, Loc));
Analyze_And_Resolve (N, PtrT);
return;
end if;
-- Ada 2005 (AI-318-02): If the initialization expression is a call -- Ada 2005 (AI-318-02): If the initialization expression is a call
-- to a build-in-place function, then access to the allocated object -- to a build-in-place function, then access to the allocated object
-- must be passed to the function. Currently we limit such functions -- must be passed to the function. Currently we limit such functions
......
...@@ -662,8 +662,7 @@ procedure GNATCmd is ...@@ -662,8 +662,7 @@ procedure GNATCmd is
function Configuration_Pragmas_File return Path_Name_Type is function Configuration_Pragmas_File return Path_Name_Type is
begin begin
Prj.Env.Create_Config_Pragmas_File Prj.Env.Create_Config_Pragmas_File (Project, Project_Tree);
(Project, Project, Project_Tree, Include_Config_Files => False);
return Project.Config_File_Name; return Project.Config_File_Name;
end Configuration_Pragmas_File; end Configuration_Pragmas_File;
...@@ -2122,6 +2121,8 @@ begin ...@@ -2122,6 +2121,8 @@ begin
File_Index : Integer := 0; File_Index : Integer := 0;
Dir_Index : Integer := 0; Dir_Index : Integer := 0;
Last : constant Integer := Last_Switches.Last; Last : constant Integer := Last_Switches.Last;
Lang : constant Language_Ptr :=
Get_Language_From_Name (Project, "ada");
begin begin
for Index in 1 .. Last loop for Index in 1 .. Last loop
...@@ -2138,7 +2139,7 @@ begin ...@@ -2138,7 +2139,7 @@ begin
-- indicate to gnatstub the name of the body file with -- indicate to gnatstub the name of the body file with
-- a -o switch. -- a -o switch.
if Body_Suffix_Id_Of (Project_Tree, Name_Ada, Project.Naming) /= if Lang.Config.Naming_Data.Body_Suffix /=
Prj.Default_Ada_Spec_Suffix Prj.Default_Ada_Spec_Suffix
then then
if File_Index /= 0 then if File_Index /= 0 then
...@@ -2148,9 +2149,7 @@ begin ...@@ -2148,9 +2149,7 @@ begin
Last : Natural := Spec'Last; Last : Natural := Spec'Last;
begin begin
Get_Name_String Get_Name_String (Lang.Config.Naming_Data.Spec_Suffix);
(Spec_Suffix_Id_Of
(Project_Tree, Name_Ada, Project.Naming));
if Spec'Length > Name_Len if Spec'Length > Name_Len
and then Spec (Last - Name_Len + 1 .. Last) = and then Spec (Last - Name_Len + 1 .. Last) =
...@@ -2158,8 +2157,7 @@ begin ...@@ -2158,8 +2157,7 @@ begin
then then
Last := Last - Name_Len; Last := Last - Name_Len;
Get_Name_String Get_Name_String
(Body_Suffix_Id_Of (Lang.Config.Naming_Data.Body_Suffix);
(Project_Tree, Name_Ada, Project.Naming));
Last_Switches.Increment_Last; Last_Switches.Increment_Last;
Last_Switches.Table (Last_Switches.Last) := Last_Switches.Table (Last_Switches.Last) :=
new String'("-o"); new String'("-o");
......
...@@ -644,7 +644,7 @@ package body Make is ...@@ -644,7 +644,7 @@ package body Make is
(Source_File : File_Name_Type; (Source_File : File_Name_Type;
Source_File_Name : String; Source_File_Name : String;
Source_Index : Int; Source_Index : Int;
Naming : Naming_Data; Project : Project_Id;
In_Package : Package_Id; In_Package : Package_Id;
Allow_ALI : Boolean) return Variable_Value; Allow_ALI : Boolean) return Variable_Value;
-- Return the switches for the source file in the specified package of a -- Return the switches for the source file in the specified package of a
...@@ -1274,7 +1274,7 @@ package body Make is ...@@ -1274,7 +1274,7 @@ package body Make is
(Source_File => Name_Find, (Source_File => Name_Find,
Source_File_Name => File_Name, Source_File_Name => File_Name,
Source_Index => Index, Source_Index => Index,
Naming => Main_Project.Naming, Project => Main_Project,
In_Package => The_Package, In_Package => The_Package,
Allow_ALI => Program = Binder or else Program = Linker); Allow_ALI => Program = Binder or else Program = Linker);
...@@ -2388,7 +2388,7 @@ package body Make is ...@@ -2388,7 +2388,7 @@ package body Make is
(Source_File => Source_File, (Source_File => Source_File,
Source_File_Name => Source_File_Name, Source_File_Name => Source_File_Name,
Source_Index => Source_Index, Source_Index => Source_Index,
Naming => Arguments_Project.Naming, Project => Arguments_Project,
In_Package => Compiler_Package, In_Package => Compiler_Package,
Allow_ALI => False); Allow_ALI => False);
...@@ -3750,7 +3750,7 @@ package body Make is ...@@ -3750,7 +3750,7 @@ package body Make is
begin begin
Prj.Env.Create_Config_Pragmas_File Prj.Env.Create_Config_Pragmas_File
(For_Project, Main_Project, Project_Tree); (For_Project, Project_Tree);
if For_Project.Config_File_Name /= No_Path then if For_Project.Config_File_Name /= No_Path then
Temporary_Config_File := For_Project.Config_File_Temp; Temporary_Config_File := For_Project.Config_File_Temp;
...@@ -4235,6 +4235,8 @@ package body Make is ...@@ -4235,6 +4235,8 @@ package body Make is
File_Name : constant String := Base_Name (Main); File_Name : constant String := Base_Name (Main);
-- The simple file name of the current main -- The simple file name of the current main
Lang : Language_Ptr;
begin begin
exit when Main = ""; exit when Main = "";
...@@ -4256,18 +4258,18 @@ package body Make is ...@@ -4256,18 +4258,18 @@ package body Make is
-- is the actual path of a source of a project. -- is the actual path of a source of a project.
if Main /= File_Name then if Main /= File_Name then
Lang := Get_Language_From_Name (Main_Project, "ada");
Real_Path := Real_Path :=
Locate_Regular_File Locate_Regular_File
(Main & (Main & Get_Name_String
Body_Suffix_Of (Lang.Config.Naming_Data.Body_Suffix),
(Project_Tree, "ada", Main_Project.Naming),
""); "");
if Real_Path = null then if Real_Path = null then
Real_Path := Real_Path :=
Locate_Regular_File Locate_Regular_File
(Main & (Main & Get_Name_String
Spec_Suffix_Of (Lang.Config.Naming_Data.Spec_Suffix),
(Project_Tree, "ada", Main_Project.Naming),
""); "");
end if; end if;
...@@ -8122,10 +8124,12 @@ package body Make is ...@@ -8122,10 +8124,12 @@ package body Make is
(Source_File : File_Name_Type; (Source_File : File_Name_Type;
Source_File_Name : String; Source_File_Name : String;
Source_Index : Int; Source_Index : Int;
Naming : Naming_Data; Project : Project_Id;
In_Package : Package_Id; In_Package : Package_Id;
Allow_ALI : Boolean) return Variable_Value Allow_ALI : Boolean) return Variable_Value
is is
Lang : constant Language_Ptr := Get_Language_From_Name (Project, "ada");
Switches : Variable_Value; Switches : Variable_Value;
Defaults : constant Array_Element_Id := Defaults : constant Array_Element_Id :=
...@@ -8156,14 +8160,17 @@ package body Make is ...@@ -8156,14 +8160,17 @@ package body Make is
-- Check also without the suffix -- Check also without the suffix
if Switches = Nil_Variable_Value then if Switches = Nil_Variable_Value
and then Lang /= null
then
declare declare
Naming : Lang_Naming_Data renames Lang.Config.Naming_Data;
Name : String (1 .. Source_File_Name'Length + 3); Name : String (1 .. Source_File_Name'Length + 3);
Last : Positive := Source_File_Name'Length; Last : Positive := Source_File_Name'Length;
Spec_Suffix : constant String := Spec_Suffix : constant String :=
Spec_Suffix_Of (Project_Tree, "ada", Naming); Get_Name_String (Naming.Spec_Suffix);
Body_Suffix : constant String := Body_Suffix : constant String :=
Body_Suffix_Of (Project_Tree, "ada", Naming); Get_Name_String (Naming.Body_Suffix);
Truncated : Boolean := False; Truncated : Boolean := False;
begin begin
......
...@@ -63,16 +63,9 @@ package Prj.Env is ...@@ -63,16 +63,9 @@ package Prj.Env is
procedure Create_Config_Pragmas_File procedure Create_Config_Pragmas_File
(For_Project : Project_Id; (For_Project : Project_Id;
Main_Project : Project_Id; In_Tree : Project_Tree_Ref);
In_Tree : Project_Tree_Ref;
Include_Config_Files : Boolean := True);
-- If there needs to have SFN pragmas, either for non standard naming -- If there needs to have SFN pragmas, either for non standard naming
-- schemes or for individual units, or (when Include_Config_Files is True) -- schemes or for individual units.
-- if Global_Configuration_Pragmas has been specified in package gnatmake
-- of the main project, or if Local_Configuration_Pragmas has been
-- specified in package Compiler of the main project, build (if needed)
-- a temporary file that contains all configuration pragmas, and specify
-- the configuration pragmas file in the project data.
procedure Create_New_Path_File procedure Create_New_Path_File
(In_Tree : Project_Tree_Ref; (In_Tree : Project_Tree_Ref;
......
...@@ -2336,6 +2336,7 @@ package body Prj.Proc is ...@@ -2336,6 +2336,7 @@ package body Prj.Proc is
begin begin
Error_Report := Report_Error; Error_Report := Report_Error;
Success := True; Success := True;
if Project /= No_Project then if Project /= No_Project then
...@@ -2581,7 +2582,7 @@ package body Prj.Proc is ...@@ -2581,7 +2582,7 @@ package body Prj.Proc is
return; return;
end if; end if;
Project := new Project_Data'(Empty_Project (In_Tree)); Project := new Project_Data'(Empty_Project);
In_Tree.Projects := new Project_List_Element' In_Tree.Projects := new Project_List_Element'
(Project => Project, (Project => Project,
Next => In_Tree.Projects); Next => In_Tree.Projects);
......
...@@ -134,7 +134,7 @@ package body Prj.Util is ...@@ -134,7 +134,7 @@ package body Prj.Util is
Executable_Suffix_Name : Name_Id := No_Name; Executable_Suffix_Name : Name_Id := No_Name;
Naming : constant Naming_Data := Project.Naming; Lang : Language_Ptr;
Spec_Suffix : Name_Id := No_Name; Spec_Suffix : Name_Id := No_Name;
Body_Suffix : Name_Id := No_Name; Body_Suffix : Name_Id := No_Name;
...@@ -143,8 +143,8 @@ package body Prj.Util is ...@@ -143,8 +143,8 @@ package body Prj.Util is
Body_Suffix_Length : Natural := 0; Body_Suffix_Length : Natural := 0;
procedure Get_Suffixes procedure Get_Suffixes
(B_Suffix : String; (B_Suffix : File_Name_Type;
S_Suffix : String); S_Suffix : File_Name_Type);
-- Get the non empty suffixes in variables Spec_Suffix and Body_Suffix -- Get the non empty suffixes in variables Spec_Suffix and Body_Suffix
------------------ ------------------
...@@ -152,22 +152,18 @@ package body Prj.Util is ...@@ -152,22 +152,18 @@ package body Prj.Util is
------------------ ------------------
procedure Get_Suffixes procedure Get_Suffixes
(B_Suffix : String; (B_Suffix : File_Name_Type;
S_Suffix : String) S_Suffix : File_Name_Type)
is is
begin begin
if B_Suffix'Length > 0 then if B_Suffix /= No_File then
Name_Len := B_Suffix'Length; Body_Suffix := Name_Id (B_Suffix);
Name_Buffer (1 .. Name_Len) := B_Suffix; Body_Suffix_Length := Natural (Length_Of_Name (Body_Suffix));
Body_Suffix := Name_Find;
Body_Suffix_Length := B_Suffix'Length;
end if; end if;
if S_Suffix'Length > 0 then if S_Suffix /= No_File then
Name_Len := S_Suffix'Length; Spec_Suffix := Name_Id (S_Suffix);
Name_Buffer (1 .. Name_Len) := S_Suffix; Spec_Suffix_Length := Natural (Length_Of_Name (Spec_Suffix));
Spec_Suffix := Name_Find;
Spec_Suffix_Length := S_Suffix'Length;
end if; end if;
end Get_Suffixes; end Get_Suffixes;
...@@ -175,14 +171,15 @@ package body Prj.Util is ...@@ -175,14 +171,15 @@ package body Prj.Util is
begin begin
if Ada_Main then if Ada_Main then
Get_Suffixes Lang := Get_Language_From_Name (Project, "ada");
(B_Suffix => Body_Suffix_Of (In_Tree, "ada", Naming),
S_Suffix => Spec_Suffix_Of (In_Tree, "ada", Naming));
elsif Language /= "" then elsif Language /= "" then
Lang := Get_Language_From_Name (Project, Language);
end if;
if Lang /= null then
Get_Suffixes Get_Suffixes
(B_Suffix => Body_Suffix_Of (In_Tree, Language, Naming), (B_Suffix => Lang.Config.Naming_Data.Body_Suffix,
S_Suffix => Spec_Suffix_Of (In_Tree, Language, Naming)); S_Suffix => Lang.Config.Naming_Data.Spec_Suffix);
end if; end if;
if Builder_Package /= No_Package then if Builder_Package /= No_Package then
...@@ -217,7 +214,8 @@ package body Prj.Util is ...@@ -217,7 +214,8 @@ package body Prj.Util is
Truncated : Boolean := False; Truncated : Boolean := False;
begin begin
if Last > Natural (Length_Of_Name (Body_Suffix)) if Body_Suffix /= No_Name
and then Last > Natural (Length_Of_Name (Body_Suffix))
and then Name (Last - Body_Suffix_Length + 1 .. Last) = and then Name (Last - Body_Suffix_Length + 1 .. Last) =
Get_Name_String (Body_Suffix) Get_Name_String (Body_Suffix)
then then
...@@ -225,7 +223,8 @@ package body Prj.Util is ...@@ -225,7 +223,8 @@ package body Prj.Util is
Last := Last - Body_Suffix_Length; Last := Last - Body_Suffix_Length;
end if; end if;
if not Truncated if Spec_Suffix /= No_Name
and then not Truncated
and then Last > Spec_Suffix_Length and then Last > Spec_Suffix_Length
and then Name (Last - Spec_Suffix_Length + 1 .. Last) = and then Name (Last - Spec_Suffix_Length + 1 .. Last) =
Get_Name_String (Spec_Suffix) Get_Name_String (Spec_Suffix)
......
...@@ -830,61 +830,6 @@ package Prj is ...@@ -830,61 +830,6 @@ package Prj is
-- The following record contains data for a naming scheme -- The following record contains data for a naming scheme
type Naming_Data is record
Dot_Replacement : File_Name_Type := No_File;
-- The string to replace '.' in the source file name (for Ada)
Casing : Casing_Type := All_Lower_Case;
-- The casing of the source file name (for Ada)
Spec_Suffix : Array_Element_Id := No_Array_Element;
-- The string to append to the unit name for the
-- source file name of a spec.
-- Indexed by the programming language.
Body_Suffix : Array_Element_Id := No_Array_Element;
-- The string to append to the unit name for the
-- source file name of a body.
-- Indexed by the programming language.
Separate_Suffix : File_Name_Type := No_File;
-- String to append to unit name for source file name of an Ada subunit
end record;
function Spec_Suffix_Of
(In_Tree : Project_Tree_Ref;
Language : String;
Naming : Naming_Data) return String;
function Spec_Suffix_Id_Of
(In_Tree : Project_Tree_Ref;
Language_Id : Name_Id;
Naming : Naming_Data) return File_Name_Type;
procedure Set_Spec_Suffix
(In_Tree : Project_Tree_Ref;
Language : String;
Naming : in out Naming_Data;
Suffix : File_Name_Type);
function Body_Suffix_Id_Of
(In_Tree : Project_Tree_Ref;
Language_Id : Name_Id;
Naming : Naming_Data) return File_Name_Type;
function Body_Suffix_Of
(In_Tree : Project_Tree_Ref;
Language : String;
Naming : Naming_Data) return String;
procedure Set_Body_Suffix
(In_Tree : Project_Tree_Ref;
Language : String;
Naming : in out Naming_Data;
Suffix : File_Name_Type);
function Get_Object_Directory function Get_Object_Directory
(Project : Project_Id; (Project : Project_Id;
Including_Libraries : Boolean; Including_Libraries : Boolean;
...@@ -906,18 +851,6 @@ package Prj is ...@@ -906,18 +851,6 @@ package Prj is
-- Returns the ultimate extending project of project Proj. If project Proj -- Returns the ultimate extending project of project Proj. If project Proj
-- is not extended, returns Proj. -- is not extended, returns Proj.
function Standard_Naming_Data
(Tree : Project_Tree_Ref := No_Project_Tree) return Naming_Data;
pragma Inline (Standard_Naming_Data);
-- The standard GNAT naming scheme when Tree is No_Project_Tree.
-- Otherwise, return the default naming scheme for the project tree Tree,
-- which must have been Initialized.
function Same_Naming_Scheme
(Left, Right : Naming_Data) return Boolean;
-- Returns True if Left and Right are the same naming scheme
-- not considering Specs and Bodies.
type Project_List_Element; type Project_List_Element;
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
...@@ -1121,9 +1054,6 @@ package Prj is ...@@ -1121,9 +1054,6 @@ package Prj is
Location : Source_Ptr := No_Location; Location : Source_Ptr := No_Location;
-- The location in the project file source of the reserved word project -- The location in the project file source of the reserved word project
Naming : Naming_Data := Standard_Naming_Data;
-- The naming scheme of this project file
--------------- ---------------
-- Languages -- -- Languages --
--------------- ---------------
...@@ -1305,9 +1235,9 @@ package Prj is ...@@ -1305,9 +1235,9 @@ package Prj is
end record; end record;
function Empty_Project (Tree : Project_Tree_Ref) return Project_Data; function Empty_Project return Project_Data;
-- Return the representation of an empty project in project Tree tree. -- Return the representation of an empty project.
-- The project tree Tree must have been Initialized and/or Reset. -- In Ada-only mode, the Ada language is also partly initialized
function Is_Extending function Is_Extending
(Extending : Project_Id; (Extending : Project_Id;
...@@ -1410,18 +1340,6 @@ package Prj is ...@@ -1410,18 +1340,6 @@ package Prj is
-- This procedure resets all the tables that are used when processing a -- This procedure resets all the tables that are used when processing a
-- project file tree. Initialize must be called before the call to Reset. -- project file tree. Initialize must be called before the call to Reset.
procedure Register_Default_Naming_Scheme
(Language : Name_Id;
Default_Spec_Suffix : File_Name_Type;
Default_Body_Suffix : File_Name_Type;
In_Tree : Project_Tree_Ref);
-- Register the default suffixes for a given language. These extensions
-- will be ignored if the user has specified a new naming scheme in a
-- project file.
--
-- Otherwise, this information will be automatically added to Naming_Data
-- when a project is processed, in the lists Spec_Suffix and Body_Suffix.
package Project_Boolean_Htable is new Simple_HTable package Project_Boolean_Htable is new Simple_HTable
(Header_Num => Header_Num, (Header_Num => Header_Num,
Element => Boolean, Element => Boolean,
...@@ -1531,16 +1449,6 @@ private ...@@ -1531,16 +1449,6 @@ private
Last : in out Natural); Last : in out Natural);
-- Append a String to the Buffer -- Append a String to the Buffer
type Naming_Id is new Nat;
package Naming_Table is new GNAT.Dynamic_Tables
(Table_Component_Type => Naming_Data,
Table_Index_Type => Naming_Id,
Table_Low_Bound => 1,
Table_Initial => 5,
Table_Increment => 100);
-- Table storing the naming data for gnatmake/gprmake
package Path_File_Table is new GNAT.Dynamic_Tables package Path_File_Table is new GNAT.Dynamic_Tables
(Table_Component_Type => Path_Name_Type, (Table_Component_Type => Path_Name_Type,
Table_Index_Type => Natural, Table_Index_Type => Natural,
...@@ -1567,26 +1475,28 @@ private ...@@ -1567,26 +1475,28 @@ private
-- A table to store the object dirs, before creating the object path file -- A table to store the object dirs, before creating the object path file
type Private_Project_Tree_Data is record type Private_Project_Tree_Data is record
Namings : Naming_Table.Instance;
Path_Files : Path_File_Table.Instance; Path_Files : Path_File_Table.Instance;
Source_Paths : Source_Path_Table.Instance; Source_Paths : Source_Path_Table.Instance;
Object_Paths : Object_Path_Table.Instance; Object_Paths : Object_Path_Table.Instance;
Default_Naming : Naming_Data;
Current_Source_Path_File : Path_Name_Type := No_Path; Current_Source_Path_File : Path_Name_Type := No_Path;
-- Current value of project source path file env var. Used to avoid -- Current value of project source path file env var. Used to avoid
-- setting the env var to the same value. -- setting the env var to the same value.
-- gnatmake only
Current_Object_Path_File : Path_Name_Type := No_Path; Current_Object_Path_File : Path_Name_Type := No_Path;
-- Current value of project object path file env var. Used to avoid -- Current value of project object path file env var. Used to avoid
-- setting the env var to the same value. -- setting the env var to the same value.
-- gnatmake only
Ada_Path_Buffer : String_Access := new String (1 .. 1024); Ada_Path_Buffer : String_Access := new String (1 .. 1024);
-- A buffer where values for ADA_INCLUDE_PATH and ADA_OBJECTS_PATH are -- A buffer where values for ADA_INCLUDE_PATH and ADA_OBJECTS_PATH are
-- stored. -- stored.
-- gnatmake only
Ada_Path_Length : Natural := 0; Ada_Path_Length : Natural := 0;
-- Index of the last valid character in Ada_Path_Buffer -- Index of the last valid character in Ada_Path_Buffer
-- gnatmake only
Ada_Prj_Include_File_Set : Boolean := False; Ada_Prj_Include_File_Set : Boolean := False;
Ada_Prj_Objects_File_Set : Boolean := False; Ada_Prj_Objects_File_Set : Boolean := False;
...@@ -1596,8 +1506,10 @@ private ...@@ -1596,8 +1506,10 @@ private
-- effect on most platforms, except on VMS where the logical names are -- effect on most platforms, except on VMS where the logical names are
-- deassigned, thus avoiding the pollution of the environment of the -- deassigned, thus avoiding the pollution of the environment of the
-- caller. -- caller.
-- gnatmake only
Fill_Mapping_File : Boolean := True; Fill_Mapping_File : Boolean := True;
-- gnatmake only
end record; end record;
-- Type to represent the part of a project tree which is private to the -- Type to represent the part of a project tree which is private to the
......
...@@ -3979,9 +3979,17 @@ package body Sem_Res is ...@@ -3979,9 +3979,17 @@ package body Sem_Res is
Check_Unset_Reference (Expression (E)); Check_Unset_Reference (Expression (E));
-- A qualified expression requires an exact match of the type, -- A qualified expression requires an exact match of the type,
-- class-wide matching is not allowed. -- class-wide matching is not allowed. We skip this test in a call
-- to a CPP constructor because in such case, although the function
-- profile indicates that it returns a class-wide type, the object
-- returned by the C++ constructor has a concrete type.
if (Is_Class_Wide_Type (Etype (Expression (E))) if Is_Class_Wide_Type (Etype (Expression (E)))
and then Is_CPP_Constructor_Call (Expression (E))
then
null;
elsif (Is_Class_Wide_Type (Etype (Expression (E)))
or else Is_Class_Wide_Type (Etype (E))) or else Is_Class_Wide_Type (Etype (E)))
and then Base_Type (Etype (Expression (E))) /= Base_Type (Etype (E)) and then Base_Type (Etype (Expression (E))) /= Base_Type (Etype (E))
then then
......
...@@ -820,6 +820,13 @@ package VMS_Data is ...@@ -820,6 +820,13 @@ package VMS_Data is
-- --
-- Work quietly, only output warnings and errors. -- Work quietly, only output warnings and errors.
S_Check_Time : aliased constant S := "/TIME " &
"-t";
-- /NOTIME (D)
-- /QUIET
--
-- Print out execution time
S_Check_Sections : aliased constant S := "/SECTIONS=" & S_Check_Sections : aliased constant S := "/SECTIONS=" &
"DEFAULT " & "DEFAULT " &
"-s123 " & "-s123 " &
...@@ -893,6 +900,7 @@ package VMS_Data is ...@@ -893,6 +900,7 @@ package VMS_Data is
S_Check_Mess 'Access, S_Check_Mess 'Access,
S_Check_Project 'Access, S_Check_Project 'Access,
S_Check_Quiet 'Access, S_Check_Quiet 'Access,
S_Check_Time 'Access,
S_Check_Sections 'Access, S_Check_Sections 'Access,
S_Check_Short 'Access, S_Check_Short 'Access,
S_Check_Subdirs 'Access, S_Check_Subdirs 'Access,
......
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