diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-11 14:46:16 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-11 14:46:16 +0200 |
commit | afb4a8cda0247500a0084508af16b7ccaf943c8b (patch) | |
tree | e729035d907f2265386759e1f898a7a50170d459 /gcc/ada/prj-makr.adb | |
parent | 7c55f4101789d76d1a9bab69631edb171321f12f (diff) | |
download | gcc-afb4a8cda0247500a0084508af16b7ccaf943c8b.zip gcc-afb4a8cda0247500a0084508af16b7ccaf943c8b.tar.gz gcc-afb4a8cda0247500a0084508af16b7ccaf943c8b.tar.bz2 |
[multiple changes]
2013-04-11 Ed Schonberg <schonberg@adacore.com>
* par-ch6.adb (P_Subprogram): Attach aspects to subprogram stub.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Allow aspects on
subprogram stubs.
* sem_ch13.adb (Analyze_Aspect_Specifications): Analyze generated
pre/post pragmas at once before analyzing the proper body.
* sem_prag.adb (Chain_PPC): Handle pragma that comes from an
aspect on a subprogram stub.
* aspects.adb: Aspect specifications can appear on a
subprogram_Body_Stub.
2013-04-11 Vincent Celier <celier@adacore.com>
* gnatname.adb: Minor comment fix.
2013-04-11 Vincent Celier <celier@adacore.com>
* prj-makr.adb (Process_Directory): Create a new temporary
file for each invocation of the compiler, in directory pointed
by environment variable TMPDIR if it exists.
2013-04-11 Arnaud Charlet <charlet@adacore.com>
* gnat_ugn.texi: Minor editing/clean ups.
From-SVN: r197781
Diffstat (limited to 'gcc/ada/prj-makr.adb')
-rw-r--r-- | gcc/ada/prj-makr.adb | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/gcc/ada/prj-makr.adb b/gcc/ada/prj-makr.adb index 3b86964..0ed8050 100644 --- a/gcc/ada/prj-makr.adb +++ b/gcc/ada/prj-makr.adb @@ -38,6 +38,7 @@ with Prj.Util; use Prj.Util; with Sdefault; with Snames; use Snames; with Table; use Table; +with Tempdir; with Ada.Characters.Handling; use Ada.Characters.Handling; with GNAT.Directory_Operations; use GNAT.Directory_Operations; @@ -1235,6 +1236,7 @@ package body Prj.Makr is Success : Boolean; Saved_Output : File_Descriptor; Saved_Error : File_Descriptor; + Tmp_File : Path_Name_Type; begin -- If we don't have the path of the compiler yet, @@ -1256,19 +1258,17 @@ package body Prj.Makr is end if; end if; - -- If we don't have yet the file name of the - -- temporary file, get it now. + -- Create the temporary file - if Temp_File_Name = null then - Create_Temp_File (FD, Temp_File_Name); + Tempdir.Create_Temp_File (FD, Tmp_File); - if FD = Invalid_FD then - Prj.Com.Fail - ("could not create temporary file"); - end if; + if FD = Invalid_FD then + Prj.Com.Fail + ("could not create temporary file"); - Close (FD); - Delete_File (Temp_File_Name.all, Success); + else + Temp_File_Name := + new String'(Get_Name_String (Tmp_File)); end if; Args (Args'Last) := new String' @@ -1276,16 +1276,6 @@ package body Prj.Makr is Directory_Separator & Str (1 .. Last)); - -- Create the temporary file - - FD := Create_Output_Text_File - (Name => Temp_File_Name.all); - - if FD = Invalid_FD then - Prj.Com.Fail - ("could not create temporary file"); - end if; - -- Save the standard output and error Saved_Output := Dup (Standout); @@ -1331,7 +1321,8 @@ package body Prj.Makr is if not Is_Valid (File) then Prj.Com.Fail - ("could not read temporary file"); + ("could not read temporary file " & + Temp_File_Name.all); end if; Save_Last_Source_Index := Sources.Last; |