diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-17 10:50:49 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-17 10:50:49 +0000 |
commit | b10d9cb373c1e925fbb37257fda46fee8f092d6a (patch) | |
tree | 19734f2f4262aa1fe1c05c9a55f71f6763d3eed7 | |
parent | d5cea4e1bc9036aabe4fdb7ac359f7cd8f5a9e58 (diff) | |
download | gcc-b10d9cb373c1e925fbb37257fda46fee8f092d6a.tar.gz |
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
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151795 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ada/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/ada/a-dynpri.adb | 8 | ||||
-rw-r--r-- | gcc/ada/exp_ch6.adb | 14 | ||||
-rw-r--r-- | gcc/ada/prj-conf.adb | 29 | ||||
-rw-r--r-- | gcc/ada/prj-env.adb | 8 | ||||
-rw-r--r-- | gcc/ada/prj-env.ads | 8 |
6 files changed, 65 insertions, 19 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 92352f55f2d..d058d97e5a3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,22 @@ 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, switch-m.adb, switch-m.ads, clean.adb, prj-tree.ads (Project_Node_Tree_Data.Project_Path): New field. diff --git a/gcc/ada/a-dynpri.adb b/gcc/ada/a-dynpri.adb index 33122176f0a..9116a573948 100644 --- a/gcc/ada/a-dynpri.adb +++ b/gcc/ada/a-dynpri.adb @@ -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; diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 238aad61043..4a31187d9d1 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -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 diff --git a/gcc/ada/prj-conf.adb b/gcc/ada/prj-conf.adb index bb70e358a74..e1b365e3453 100644 --- a/gcc/ada/prj-conf.adb +++ b/gcc/ada/prj-conf.adb @@ -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; diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb index 0ffacdbdc5b..c5182abea09 100644 --- a/gcc/ada/prj-env.adb +++ b/gcc/ada/prj-env.adb @@ -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 -- ---------------------- diff --git a/gcc/ada/prj-env.ads b/gcc/ada/prj-env.ads index ffcea0756b6..8cebad50524 100644 --- a/gcc/ada/prj-env.ads +++ b/gcc/ada/prj-env.ads @@ -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; |