Commit 527f5eb6 by Arnaud Charlet

[multiple changes]

2014-10-31  Vincent Celier  <celier@adacore.com>

	* prj-conf.adb (Look_For_Project_Paths): New procedure
	(Parse_Project_And_Apply_Config): Initially, parse the project
	files ignoring missing withs. If there are missing withs, extend
	the project path with directories rooted at the compiler roots,
	including directories rooted at the runtime roots, if there are
	non default runtimes, in the PATH orser.
	* prj-env.adb (Initialize_Default_Project_Path): Do not add
	any directory from the prefix if the target is "-".
	* prj-part.adb (Parse): Initialize the tables, as Parse may be
	call several times by gprbuild.
	* prj.adb (Update_Ignore_Missing_With): New procedure.

2014-10-31  Ed Schonberg  <schonberg@adacore.com>

	* sem_aux.adb (First_Stored_Discriminant,
	Has_Completely_Hidden_Discriminant): When scanning the list of
	discriminants to locate possibly hidden (inherited) discriminants,
	ignore itypes that may appear in the entity list, when an access
	discriminants is constrained by an access attribute reference.

2014-10-31  Javier Miranda  <miranda@adacore.com>

	* freeze.adb (Freeze_Record_Type): Add missing
	check to verify that all the primitives of an interface type
	are abstract or null procedures.

2014-10-31  Vincent Celier  <celier@adacore.com>

	* s-os_lib.adb, s-os_lib.ads: New function Non_Blocking_Spawn that
	redirects standard output and standard error to two different files.

2014-10-31  Bob Duff  <duff@adacore.com>

	* makeutl.ads: Minor comment fix.

2014-10-31  Arnaud Charlet  <charlet@adacore.com>

	* system-linux-x86_64.ads, system-mingw-x86_64.ads (Word_Size,
	Memory_Size): Use Standard'Word_Size so that the value can be changed
	via a target configuration file.

From-SVN: r216965
parent 14258928
2014-10-31 Vincent Celier <celier@adacore.com>
* prj-conf.adb (Look_For_Project_Paths): New procedure
(Parse_Project_And_Apply_Config): Initially, parse the project
files ignoring missing withs. If there are missing withs, extend
the project path with directories rooted at the compiler roots,
including directories rooted at the runtime roots, if there are
non default runtimes, in the PATH orser.
* prj-env.adb (Initialize_Default_Project_Path): Do not add
any directory from the prefix if the target is "-".
* prj-part.adb (Parse): Initialize the tables, as Parse may be
call several times by gprbuild.
* prj.adb (Update_Ignore_Missing_With): New procedure.
2014-10-31 Ed Schonberg <schonberg@adacore.com>
* sem_aux.adb (First_Stored_Discriminant,
Has_Completely_Hidden_Discriminant): When scanning the list of
discriminants to locate possibly hidden (inherited) discriminants,
ignore itypes that may appear in the entity list, when an access
discriminants is constrained by an access attribute reference.
2014-10-31 Javier Miranda <miranda@adacore.com>
* freeze.adb (Freeze_Record_Type): Add missing
check to verify that all the primitives of an interface type
are abstract or null procedures.
2014-10-31 Vincent Celier <celier@adacore.com>
* s-os_lib.adb, s-os_lib.ads: New function Non_Blocking_Spawn that
redirects standard output and standard error to two different files.
2014-10-31 Bob Duff <duff@adacore.com>
* makeutl.ads: Minor comment fix.
2014-10-31 Arnaud Charlet <charlet@adacore.com>
* system-linux-x86_64.ads, system-mingw-x86_64.ads (Word_Size,
Memory_Size): Use Standard'Word_Size so that the value can be changed
via a target configuration file.
2014-10-31 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb: Minor tweak.
......
......@@ -4004,6 +4004,47 @@ package body Freeze is
-- call to the Analyze_Freeze_Entity for the record type.
end Check_Variant_Part;
-- Check that all the primitives of an interface type are abstract
-- or null procedures.
if Is_Interface (Rec)
and then not Error_Posted (Parent (Rec))
then
declare
Elmt : Elmt_Id;
Subp : Entity_Id;
begin
Elmt := First_Elmt (Primitive_Operations (Rec));
while Present (Elmt) loop
Subp := Node (Elmt);
if not Is_Abstract_Subprogram (Subp)
-- Avoid reporting the error on inherited primitives
and then Comes_From_Source (Subp)
then
Error_Msg_Name_1 := Chars (Subp);
if Ekind (Subp) = E_Procedure then
if not Null_Present (Parent (Subp)) then
Error_Msg_N
("interface procedure % must be abstract or null",
Parent (Subp));
end if;
else
Error_Msg_N
("interface function % must be abstract",
Parent (Subp));
end if;
end if;
Next_Elmt (Elmt);
end loop;
end;
end if;
end Freeze_Record_Type;
-------------------------------
......
......@@ -254,8 +254,8 @@ package Makeutl is
-- file. This checks various attributes to see if there are file specific
-- switches, or else defaults on the switches for the corresponding
-- language. Is_Default is set to False if there were file-specific
-- switches Source_File can be set to No_File to force retrieval of the
-- default switches. If Test_Without_Suffix is True, and there is no " for
-- switches. Source_File can be set to No_File to force retrieval of the
-- default switches. If Test_Without_Suffix is True, and there is no "for
-- Switches(Source_File) use", then this procedure also tests without the
-- extension of the filename. If Test_Without_Suffix is True and
-- Check_ALI_Suffix is True, then we also replace the file extension with
......
......@@ -1876,7 +1876,7 @@ package body Prj.Env is
(Self : in out Project_Search_Path;
Target_Name : String)
is
Add_Default_Dir : Boolean := True;
Add_Default_Dir : Boolean := Target_Name /= "-";
First : Positive;
Last : Positive;
......
......@@ -175,8 +175,10 @@ package Prj.Env is
Target_Name : String);
-- Initialize Self. It will then contain the default project path on the
-- given target (including directories specified by the environment
-- variables ADA_PROJECT_PATH and GPR_PROJECT_PATH). This does nothing if
-- Self has already been initialized.
-- variables GPR_PROJECT_PATH_FILE, GPR_PROJECT_PATH and ADA_PROJECT_PATH).
-- If one of the directory or Target_Name is "-", then the path contains
-- only those directories specified by the environment variables (except
-- "-"). This does nothing if Self has already been initialized.
procedure Copy (From : Project_Search_Path; To : out Project_Search_Path);
-- Copy From into To
......
......@@ -553,6 +553,8 @@ package body Prj.Part is
begin
In_Tree.Incomplete_With := False;
Project_Stack.Init;
Tree_Private_Part.Projects_Htable.Reset (In_Tree.Projects_HT);
if not Is_Initialized (Env.Project_Path) then
Prj.Env.Initialize_Default_Project_Path
......
......@@ -2147,6 +2147,17 @@ package body Prj is
(Root_Project, Root_Tree, Project_Context'(False, False));
end For_Project_And_Aggregated_Context;
--------------------------------
-- Update_Ignore_Missing_With --
--------------------------------
procedure Update_Ignore_Missing_With
(Flags : in out Processing_Flags; Value : Boolean)
is
begin
Flags.Ignore_Missing_With := Value;
end Update_Ignore_Missing_With;
-- Package initialization for Prj
begin
......
......@@ -1893,6 +1893,10 @@ package Prj is
-- * user project also includes a "with" that can only be resolved
-- once we have found the gnatls
procedure Update_Ignore_Missing_With
(Flags : in out Processing_Flags; Value : Boolean);
-- Update the value of component Ignore_Missing_With in Flags with Value
Gprbuild_Flags : constant Processing_Flags;
Gprinstall_Flags : constant Processing_Flags;
Gprclean_Flags : constant Processing_Flags;
......
......@@ -1698,6 +1698,54 @@ package body System.OS_Lib is
end if;
end Non_Blocking_Spawn;
function Non_Blocking_Spawn
(Program_Name : String;
Args : Argument_List;
Stdout_File : String;
Stderr_File : String) return Process_Id
is
Stdout_FD : constant File_Descriptor :=
Create_Output_Text_File (Stdout_File);
Stderr_FD : constant File_Descriptor :=
Create_Output_Text_File (Stderr_File);
Saved_Output : File_Descriptor;
Saved_Error : File_Descriptor;
Result : Process_Id;
begin
-- Do not attempt to spawn if the output files could not be created
if Stdout_FD = Invalid_FD or else Stderr_FD = Invalid_FD then
return Invalid_Pid;
end if;
-- Set standard output and error to the specified files
Saved_Output := Dup (Standout);
Dup2 (Stdout_FD, Standout);
Saved_Error := Dup (Standerr);
Dup2 (Stderr_FD, Standerr);
-- Spawn the program
Result := Non_Blocking_Spawn (Program_Name, Args);
-- Restore the standard output and error
Dup2 (Saved_Output, Standout);
Dup2 (Saved_Error, Standerr);
-- And close the saved standard output and error file descriptors
Close (Saved_Output);
Close (Saved_Error);
return Result;
end Non_Blocking_Spawn;
-------------------------
-- Normalize_Arguments --
-------------------------
......
......@@ -856,6 +856,15 @@ package System.OS_Lib is
-- This function will always return Invalid_Pid under VxWorks, since there
-- is no notion of executables under this OS.
function Non_Blocking_Spawn
(Program_Name : String;
Args : Argument_List;
Stdout_File : String;
Stderr_File : String) return Process_Id;
-- Similar to the procedure above, but saves the standard output of the
-- command to a file with the name Stdout_File and the standard output
-- of the command to a file with the name Stderr_File.
procedure Wait_Process (Pid : out Process_Id; Success : out Boolean);
-- Wait for the completion of any of the processes created by previous
-- calls to Non_Blocking_Spawn. The caller will be suspended until one of
......
......@@ -282,6 +282,8 @@ package body Sem_Aux is
(Typ : Entity_Id) return Boolean;
-- Scans the Discriminants to see whether any are Completely_Hidden
-- (the mechanism for describing non-specified stored discriminants)
-- Note that the entity list for the type may contain anonymous access
-- types created by expressions that constrain access discriminants.
----------------------------------------
-- Has_Completely_Hidden_Discriminant --
......@@ -296,8 +298,17 @@ package body Sem_Aux is
pragma Assert (Ekind (Typ) = E_Discriminant);
Ent := Typ;
while Present (Ent) and then Ekind (Ent) = E_Discriminant loop
if Is_Completely_Hidden (Ent) then
while Present (Ent) loop
-- Skip anonymous types that may be created by expressions
-- used as discriminant constraints on inherited discriminants.
if Is_Itype (Ent) then
null;
elsif Ekind (Ent) = E_Discriminant
and then Is_Completely_Hidden (Ent)
then
return True;
end if;
......@@ -322,7 +333,8 @@ package body Sem_Aux is
if Has_Completely_Hidden_Discriminant (Ent) then
while Present (Ent) loop
exit when Is_Completely_Hidden (Ent);
exit when Ekind (Ent) = E_Discriminant
and then Is_Completely_Hidden (Ent);
Ent := Next_Entity (Ent);
end loop;
end if;
......
......@@ -69,8 +69,8 @@ package System is
Null_Address : constant Address;
Storage_Unit : constant := 8;
Word_Size : constant := 64;
Memory_Size : constant := 2 ** 64;
Word_Size : constant := Standard'Word_Size;
Memory_Size : constant := 2 ** Word_Size;
-- Address comparison
......
......@@ -69,8 +69,8 @@ package System is
Null_Address : constant Address;
Storage_Unit : constant := 8;
Word_Size : constant := 64;
Memory_Size : constant := 2 ** 64;
Word_Size : constant := Standard'Word_Size;
Memory_Size : constant := 2 ** Word_Size;
-- Address comparison
......
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