diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-10-27 14:06:06 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-10-27 14:06:06 +0100 |
commit | 477b99b63b10d050198e60bf44d8c1d3d89d5a0b (patch) | |
tree | 0214bfd0d71f1fd62a7120a78eeb8925bd3ed168 /gcc | |
parent | 673beced43fa873c9d4158b9c60424d5392f20a3 (diff) | |
download | gcc-477b99b63b10d050198e60bf44d8c1d3d89d5a0b.zip gcc-477b99b63b10d050198e60bf44d8c1d3d89d5a0b.tar.gz gcc-477b99b63b10d050198e60bf44d8c1d3d89d5a0b.tar.bz2 |
[multiple changes]
2009-10-27 Arnaud Charlet <charlet@adacore.com>
* exp_aggr.adb: Fix comment.
2009-10-27 Emmanuel Briot <briot@adacore.com>
* prj-err.adb (Error_Msg): take into account continuation lines when
computing whether we have a warning.
2009-10-27 Vasiliy Fofanov <fofanov@adacore.com>
* make.adb, s-os_lib.adb, s-os_lib.ads (Create_Temp_Output_File): New
routine that is designed to create temp file descriptor specifically
for redirecting an output stream.
From-SVN: r153591
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/ada/exp_aggr.adb | 2 | ||||
-rw-r--r-- | gcc/ada/make.adb | 2 | ||||
-rw-r--r-- | gcc/ada/prj-err.adb | 8 | ||||
-rwxr-xr-x | gcc/ada/s-os_lib.adb | 38 | ||||
-rwxr-xr-x | gcc/ada/s-os_lib.ads | 24 |
6 files changed, 81 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index dae8d31..d23b7c1 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,18 @@ +2009-10-27 Arnaud Charlet <charlet@adacore.com> + + * exp_aggr.adb: Fix comment. + +2009-10-27 Emmanuel Briot <briot@adacore.com> + + * prj-err.adb (Error_Msg): take into account continuation lines when + computing whether we have a warning. + +2009-10-27 Vasiliy Fofanov <fofanov@adacore.com> + + * make.adb, s-os_lib.adb, s-os_lib.ads (Create_Temp_Output_File): New + routine that is designed to create temp file descriptor specifically + for redirecting an output stream. + 2009-10-24 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 913e46d..75eb8f5 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -509,7 +509,7 @@ package body Exp_Aggr is -- 10. No controlled actions need to be generated for components - -- 11. The backend is a No_VM backend and the array has aliased components + -- 11. For a VM back end, the array should have no aliased components function Backend_Processing_Possible (N : Node_Id) return Boolean is Typ : constant Entity_Id := Etype (N); diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index dacf290..c7eab81 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -7372,7 +7372,7 @@ package body Make is Multilib_Gcc_Path := GNAT.OS_Lib.Locate_Exec_On_Path (Multilib_Gcc.all); - Create_Temp_File (Output_FD, Output_Name); + Create_Temp_Output_File (Output_FD, Output_Name); if Output_FD = Invalid_FD then return; diff --git a/gcc/ada/prj-err.adb b/gcc/ada/prj-err.adb index 8e0d562..cf76c8f 100644 --- a/gcc/ada/prj-err.adb +++ b/gcc/ada/prj-err.adb @@ -23,6 +23,7 @@ -- -- ------------------------------------------------------------------------------ +with Err_Vars; with Output; use Output; with Stringt; use Stringt; @@ -117,7 +118,12 @@ package body Prj.Err is if Flags.Report_Error /= null then Flags.Report_Error (Project, - Is_Warning => Msg (Msg'First) = '?' or else Msg (Msg'First) = '<'); + Is_Warning => Msg (Msg'First) = '?' + or else (Msg (Msg'First) = '<' + and then Err_Vars.Error_Msg_Warn) + or else (Msg (Msg'First) = '\' + and then Msg (Msg'First + 1) = '<' + and then Err_Vars.Error_Msg_Warn)); end if; end Error_Msg; diff --git a/gcc/ada/s-os_lib.adb b/gcc/ada/s-os_lib.adb index 0f2081a..a3f4b49 100755 --- a/gcc/ada/s-os_lib.adb +++ b/gcc/ada/s-os_lib.adb @@ -80,6 +80,15 @@ package body System.OS_Lib is -- Returns total number of characters needed to create a string -- of all Args terminated by ASCII.NUL characters + procedure Create_Temp_File_Internal + (FD : out File_Descriptor; + Name : out String_Access; + Stdout : Boolean); + -- Internal routine to implement two Create_Temp_File routines. If Stdout + -- is set to True the created descriptor is stdout-compatible, otherwise + -- it might not be depending on the OS (VMS is one example). The first two + -- parameters are as in Create_Temp_File. + function C_String_Length (S : Address) return Integer; -- Returns the length of a C string. Does check for null address -- (returns 0). @@ -749,6 +758,27 @@ package body System.OS_Lib is (FD : out File_Descriptor; Name : out String_Access) is + begin + Create_Temp_File_Internal (FD, Name, Stdout => False); + end Create_Temp_File; + + procedure Create_Temp_Output_File + (FD : out File_Descriptor; + Name : out String_Access) + is + begin + Create_Temp_File_Internal (FD, Name, Stdout => True); + end Create_Temp_Output_File; + + ------------------------------- + -- Create_Temp_File_Internal -- + ------------------------------- + + procedure Create_Temp_File_Internal + (FD : out File_Descriptor; + Name : out String_Access; + Stdout : Boolean) + is Pos : Positive; Attempts : Natural := 0; Current : String (Current_Temp_File_Name'Range); @@ -814,7 +844,11 @@ package body System.OS_Lib is -- Attempt to create the file - FD := Create_New_File (Current, Binary); + if Stdout then + FD := Create_Output_Text_File (Current); + else + FD := Create_File (Current, Binary); + end if; if FD /= Invalid_FD then Name := new String'(Current); @@ -836,7 +870,7 @@ package body System.OS_Lib is end if; end if; end loop File_Loop; - end Create_Temp_File; + end Create_Temp_File_Internal; ----------------- -- Delete_File -- diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads index b77b3f0..034a7f0 100755 --- a/gcc/ada/s-os_lib.ads +++ b/gcc/ada/s-os_lib.ads @@ -245,9 +245,27 @@ package System.OS_Lib is Name : out String_Access); -- Create and open for writing a temporary file in the current working -- directory. The name of the file and the File Descriptor are returned. - -- No mode parameter is provided. Since this is a temporary file, there is - -- no point in doing text translation on it. It is the responsibility of - -- the caller to deallocate the access value returned in Name. + -- It is the responsibility of the caller to deallocate the access value + -- returned in Name. + -- + -- The file is opened in binary mode (no text translation). + -- + -- This procedure will always succeed if the current working directory is + -- writable. If the current working directory is not writable, then + -- Invalid_FD is returned for the file descriptor and null for the Name. + -- There is no race condition problem between processes trying to create + -- temp files at the same time in the same directory. + + procedure Create_Temp_Output_File + (FD : out File_Descriptor; + Name : out String_Access); + -- Create and open for writing a temporary file in the current working + -- directory suitable to redirect standard output. The name of the file + -- and the File Descriptor are returned. + -- It is the responsibility of the caller to deallocate the access value + -- returned in Name. + -- + -- The file is opened in the mode specified by the With_Mode parameter. -- -- This procedure will always succeed if the current working directory is -- writable. If the current working directory is not writable, then |