[multiple changes]

2009-09-17  Emmanuel Briot  <briot@adacore.com>

	* prj-conf.adb, prj-env.adb, prj-env.ads (Create_Temp_File): Moved to
	spec.
	(Do_Autoconf): If the object directory does not exists, create auto.cgpr
	in a temporary directory instead

2009-09-17  Bob Duff  <duff@adacore.com>

	* a-dynpri.adb (Set_Priority): Don't do anything if the task is already
	terminated.
	(Get_Priority): Correct message for "terminated" case -- it said "null".

2009-09-17  Robert Dewar  <dewar@adacore.com>

	* exp_ch6.adb: Minor reformatting

From-SVN: r151795
This commit is contained in:
Arnaud Charlet 2009-09-17 12:50:49 +02:00
parent 52545f22b4
commit 1c6b973ab5
6 changed files with 65 additions and 19 deletions

View File

@ -1,3 +1,20 @@
2009-09-17 Emmanuel Briot <briot@adacore.com>
* prj-conf.adb, prj-env.adb, prj-env.ads (Create_Temp_File): Moved to
spec.
(Do_Autoconf): If the object directory does not exists, create auto.cgpr
in a temporary directory instead
2009-09-17 Bob Duff <duff@adacore.com>
* a-dynpri.adb (Set_Priority): Don't do anything if the task is already
terminated.
(Get_Priority): Correct message for "terminated" case -- it said "null".
2009-09-17 Robert Dewar <dewar@adacore.com>
* exp_ch6.adb: Minor reformatting
2009-09-17 Emmanuel Briot <briot@adacore.com>
* gnatcmd.adb, make.adb, prj-part.adb, prj-ext.adb, prj-ext.ads,

View File

@ -67,7 +67,7 @@ package body Ada.Dynamic_Priorities is
end if;
if Task_Identification.Is_Terminated (T) then
raise Tasking_Error with Error_Message & "null task";
raise Tasking_Error with Error_Message & "terminated task";
end if;
return Target.Common.Base_Priority;
@ -93,8 +93,12 @@ package body Ada.Dynamic_Priorities is
raise Program_Error with Error_Message & "null task";
end if;
-- Setting the priority of an already-terminated task doesn't do
-- anything (see RM-D.5.1(7)). Note that Get_Priority is different in
-- this regard.
if Task_Identification.Is_Terminated (T) then
raise Tasking_Error with Error_Message & "terminated task";
return;
end if;
SSL.Abort_Defer.all;

View File

@ -171,9 +171,9 @@ package body Exp_Ch6 is
--
-- A := TypeA (Temp);
--
-- after the call. Here TypeA is the actual type of variable A.
-- For out parameters, the initial declaration has no expression.
-- If A is not an entity name, we generate instead:
-- after the call. Here TypeA is the actual type of variable A. For out
-- parameters, the initial declaration has no expression. If A is not an
-- entity name, we generate instead:
--
-- Var : TypeA renames A;
-- Temp : T := Var; -- omitting expression for out parameter.
@ -183,8 +183,8 @@ package body Exp_Ch6 is
-- For other in-out parameters, we emit the required constraint checks
-- before and/or after the call.
--
-- For all parameter modes, actuals that denote components and slices
-- of packed arrays are expanded into suitable temporaries.
-- For all parameter modes, actuals that denote components and slices of
-- packed arrays are expanded into suitable temporaries.
--
-- For non-scalar objects that are possibly unaligned, add call by copy
-- code (copy in for IN and IN OUT, copy out for OUT and IN OUT).
@ -419,8 +419,8 @@ package body Exp_Ch6 is
-- Create the actual which is a pointer to the appropriate finalization
-- list. Acc_Type is present if and only if this call is the
-- initialization of an allocator. Use the Current_Scope or the Acc_Type
-- as appropriate.
-- initialization of an allocator. Use the Current_Scope or the
-- Acc_Type as appropriate.
if Present (Acc_Type)
and then (Ekind (Acc_Type) = E_Anonymous_Access_Type

View File

@ -29,6 +29,7 @@ with Makeutl; use Makeutl;
with MLib.Tgt;
with Opt; use Opt;
with Output; use Output;
with Prj.Env;
with Prj.Err;
with Prj.Part;
with Prj.PP;
@ -696,6 +697,7 @@ package body Prj.Conf is
Switches : Argument_List_Access := Get_Config_Switches;
Args : Argument_List (1 .. 5);
Arg_Last : Positive;
Obj_Dir_Exists : Boolean := True;
begin
-- Check if the object directory exists. If Setup_Projects is True
@ -731,6 +733,7 @@ package body Prj.Conf is
Prj.Err.Error_Msg
(Flags,
"?object directory " & Obj_Dir & " does not exist");
Obj_Dir_Exists := False;
when Silent =>
null;
end case;
@ -744,8 +747,30 @@ package body Prj.Conf is
-- If no config file was specified, set the auto.cgpr one
if Config_File_Name = "" then
Args (3) := new String'
(Obj_Dir & Directory_Separator & Auto_Cgpr);
if Obj_Dir_Exists then
Args (3) := new String'
(Obj_Dir & Directory_Separator & Auto_Cgpr);
else
declare
Path_FD : File_Descriptor;
Path_Name : Path_Name_Type;
begin
Prj.Env.Create_Temp_File
(In_Tree => Project_Tree,
Path_FD => Path_FD,
Path_Name => Path_Name,
File_Use => "configuration file");
if Path_FD /= Invalid_FD then
Args (3) := new String'(Get_Name_String (Path_Name));
GNAT.OS_Lib.Close (Path_FD);
else
-- We'll have an error message later on
Args (3) := new String'
(Obj_Dir & Directory_Separator & Auto_Cgpr);
end if;
end;
end if;
else
Args (3) := new String'(Config_File_Name);
end if;

View File

@ -97,14 +97,6 @@ package body Prj.Env is
-- Return a project that is either Project or an extended ancestor of
-- Project that itself is not extended.
procedure Create_Temp_File
(In_Tree : Project_Tree_Ref;
Path_FD : out File_Descriptor;
Path_Name : out Path_Name_Type;
File_Use : String);
-- Create a temporary file, and fail with an error if it could not be
-- created.
----------------------
-- Ada_Include_Path --
----------------------

View File

@ -39,6 +39,14 @@ package Prj.Env is
-- of package Fmap), so that Osint.Find_File will find the correct path
-- corresponding to a source.
procedure Create_Temp_File
(In_Tree : Project_Tree_Ref;
Path_FD : out File_Descriptor;
Path_Name : out Path_Name_Type;
File_Use : String);
-- Create a temporary file, and fail with an error if it could not be
-- created.
procedure Create_Mapping_File
(Project : Project_Id;
Language : Name_Id;