aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gnatcmd.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-10-01 10:27:31 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2012-10-01 10:27:31 +0200
commit05b34c1837a1170b534e532801b0ac8126726e66 (patch)
treecff8f1dd541a406e11a30c3790b5f81385699ffc /gcc/ada/gnatcmd.adb
parentc92e858604925ce6a7085faec27421ed70949719 (diff)
downloadgcc-05b34c1837a1170b534e532801b0ac8126726e66.zip
gcc-05b34c1837a1170b534e532801b0ac8126726e66.tar.gz
gcc-05b34c1837a1170b534e532801b0ac8126726e66.tar.bz2
[multiple changes]
2012-10-01 Vincent Celier <celier@adacore.com> * make.adb (Scan_Make_Arg): Only test for "vP" of the option includes at least 3 characters. * gnatcmd.adb (GNATCmd): Ditto. 2012-10-01 Eric Botcazou <ebotcazou@adacore.com> * exp_ch7.adb, sinfo.ads: Add comments. 2012-10-01 Robert Dewar <dewar@adacore.com> * checks.adb: Remove reference to Enable_Overflow_Checks Use Suppress_Options rather than Scope_Suppress. * gnat1drv.adb (Adjust_Global_Switches): Handle new overflow settings (Adjust_Global_Switches): Initialize Scope_Suppress from Suppress_Options. * opt.adb: Remove Enable_Overflow_Checks (use Suppress_Options instead). * opt.ads: Remove Overflow_Checks_Unsuppressed (not used) Remove Enable_Overflow_Checks (use Suppress_Options instead) Suppress_Options is now current setting (replaces Scope_Suppress). * osint.adb (Initialize): Deal with initializing overflow checking. * par-prag.adb: Add dummy entry for pragma Overflow_Checks. * sem.adb (Semantics): Save and restore In_Assertion_Expr Use Suppress_Options instead of Scope_Suppress. * sem.ads (In_Assertion_Expr): New flag (Scope_Suppress): Removed, use Suppress_Options instead. * sem_eval.adb (Compile_Time_Compare): Return Unknown in preanalysis mode. * sem_prag.adb (Process_Suppress_Unsuppress): Setting of Overflow_Checks_Unsuppressed removed (not used anywhere!) (Analyze_Pragma, case Check): Set In_Assertion_Expression (Analyze_Pragma, case Overflow_Checks): Implement new pragma * snames.ads-tmpl: Add names needed for handling pragma Overflow_Checks * switch-c.adb (Scan_Front_End_Switches) Handle -gnato? and -gnato?? where ? is 0-3 * types.ads: Updates and fixes to comment on Suppress_Record. 2012-10-01 Vincent Celier <celier@adacore.com> * prj-part.adb (Parse): Remove incorrect comment about checking imported non extending projects from and "extending all" one. Minor correction. From-SVN: r191895
Diffstat (limited to 'gcc/ada/gnatcmd.adb')
-rw-r--r--gcc/ada/gnatcmd.adb39
1 files changed, 29 insertions, 10 deletions
diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb
index ef93f2f..ab4ddcc 100644
--- a/gcc/ada/gnatcmd.adb
+++ b/gcc/ada/gnatcmd.adb
@@ -848,6 +848,9 @@ procedure GNATCmd is
Unit : Unit_Index;
Path : Path_Name_Type;
+ Files_File : Ada.Text_IO.File_Type;
+ Temp_File_Name : Path_Name_Type;
+
begin
if GN_Path = null then
Put_Line (Standard_Error, "could not locate " & GN_Name);
@@ -856,7 +859,7 @@ procedure GNATCmd is
-- Create the temp file
- Tempdir.Create_Temp_File (FD, Name);
+ Prj.Env.Create_Temp_File (Project_Tree.Shared, FD, Name, "files");
-- And close it, because on VMS Spawn with a file descriptor created
-- with Create_Temp_File does not redirect output.
@@ -904,8 +907,19 @@ procedure GNATCmd is
raise Error_Exit;
else
- -- Get each file name in the file, find its path and add it the
- -- list of arguments.
+ -- Create a temporary file to put the list of files in the closure
+
+ Tempdir.Create_Temp_File (FD, Temp_File_Name);
+ Last_Switches.Increment_Last;
+ Last_Switches.Table (Last_Switches.Last) :=
+ new String'("-files=" & Get_Name_String (Temp_File_Name));
+
+ Close (FD);
+
+ Open (Files_File, Out_File, Get_Name_String (Temp_File_Name));
+
+ -- Get each file name in the file, find its path and add it the list
+ -- of arguments.
while not End_Of_File (File) loop
Get_Line (File, Line, Last);
@@ -933,18 +947,16 @@ procedure GNATCmd is
Unit := Units_Htable.Get_Next (Project_Tree.Units_HT);
end loop;
- Last_Switches.Increment_Last;
-
if Path /= No_Path then
- Last_Switches.Table (Last_Switches.Last) :=
- new String'(Get_Name_String (Path));
+ Put_Line (Files_File, Get_Name_String (Path));
else
- Last_Switches.Table (Last_Switches.Last) :=
- new String'(Line (1 .. Last));
+ Put_Line (Files_File, Line (1 .. Last));
end if;
end loop;
+ Close (Files_File);
+
begin
if not Keep_Temporary_Files then
Delete (File);
@@ -1769,7 +1781,9 @@ begin
-- -vPx Specify verbosity while parsing project files
- elsif Argv (Argv'First + 1 .. Argv'First + 2) = "vP" then
+ elsif Argv'Length >= 3
+ and then Argv (Argv'First + 1 .. Argv'First + 2) = "vP"
+ then
if Argv'Length = 4
and then Argv (Argv'Last) in '0' .. '2'
then
@@ -2055,6 +2069,11 @@ begin
or else The_Command = Link
or else The_Command = Elim
then
+ if Project.Object_Directory.Name = No_Path then
+ Fail ("project " & Get_Name_String (Project.Display_Name) &
+ " has no object directory");
+ end if;
+
Change_Dir (Get_Name_String (Project.Object_Directory.Name));
end if;