[multiple changes]

2014-08-01  Robert Dewar  <dewar@adacore.com>

	* sem_aggr.adb, sem_ch3.adb, sem_ch5.adb, sem_util.adb,
	sem_res.adb: Minor reformatting.

2014-08-01  Vincent Celier  <celier@adacore.com>

	* make.adb (Initialize): Set Keep_Temporary_Files to True when
	-dn is specified.
	* makeusg.adb: Add line for new switch --keep-temp-files.
	* makeutl.ads (Keep_Temp_Files_Option): New constant String.
	* opt.ads (Keep_Temporary_Files): Document that it is also used
	by gnatmake and gprbuild.
	* switch-m.adb: Recognize new switch --keep-temp-files.

From-SVN: r213451
This commit is contained in:
Arnaud Charlet 2014-08-01 12:28:52 +02:00
parent 24de083ff5
commit b330e3c866
13 changed files with 51 additions and 28 deletions

View File

@ -1,3 +1,18 @@
2014-08-01 Robert Dewar <dewar@adacore.com>
* sem_aggr.adb, sem_ch3.adb, sem_ch5.adb, sem_util.adb,
sem_res.adb: Minor reformatting.
2014-08-01 Vincent Celier <celier@adacore.com>
* make.adb (Initialize): Set Keep_Temporary_Files to True when
-dn is specified.
* makeusg.adb: Add line for new switch --keep-temp-files.
* makeutl.ads (Keep_Temp_Files_Option): New constant String.
* opt.ads (Keep_Temporary_Files): Document that it is also used
by gnatmake and gprbuild.
* switch-m.adb: Recognize new switch --keep-temp-files.
2014-08-01 Tristan Gingold <gingold@adacore.com>
* sem_ch9.adb (Analyze_Task_Type_Declaration): Move code from ...

View File

@ -789,6 +789,7 @@ package body Debug is
-- dm Issue a message indicating the maximum number of simultaneous
-- compilations.
-- Equivalent to --keep-temp-files.
-- dn Do not delete temporary files created by gnatmake at the end
-- of execution, such as temporary config pragma files, mapping
@ -796,6 +797,7 @@ package body Debug is
-- dp Prints the Q used by routine Make.Compile_Sources every time
-- we go around the main compile loop of Make.Compile_Sources
-- Equivalent to --keep-temp-files.
-- dq Prints source files as they are enqueued and dequeued in the Q
-- used by routine Make.Compile_Sources. Useful to figure out the

View File

@ -3788,7 +3788,7 @@ package body Make is
-- Delete any temporary configuration pragma file
if not Debug.Debug_Flag_N then
if not Keep_Temporary_Files then
Delete_Temp_Config_Files (Project_Tree);
end if;
end Compile_Sources;
@ -3966,7 +3966,7 @@ package body Make is
-- created when using a project file.
if Main_Project = No_Project
or else Debug.Debug_Flag_N
or else Opt.Keep_Temporary_Files
or else Args (J)'Length < 8
or else
Args (J) (Args (J)'First .. Args (J)'First + 6) /= "-gnatem"
@ -3977,7 +3977,7 @@ package body Make is
-- Reset Temporary_Config_File to False so that the eventual
-- other -gnatec switches will be displayed.
if (not Debug.Debug_Flag_N)
if (not Opt.Keep_Temporary_Files)
and then Temporary_Config_File
and then Args (J)'Length > 7
and then Args (J) (Args (J)'First .. Args (J)'First + 6)
@ -3988,7 +3988,7 @@ package body Make is
-- Do not display the -F=mapping_file switch for gnatbind
-- if -dn is not specified.
elsif Debug.Debug_Flag_N
elsif Opt.Keep_Temporary_Files
or else Args (J)'Length < 4
or else
Args (J) (Args (J)'First .. Args (J)'First + 2) /= "-F="
@ -6650,6 +6650,9 @@ package body Make is
Project_Of_Current_Object_Directory := No_Project;
if Debug.Debug_Flag_N then
Opt.Keep_Temporary_Files := True;
end if;
end Initialize;
----------------------------

View File

@ -257,12 +257,6 @@ begin
Write_Eol;
Write_Eol;
-- Line for -dn
Write_Str (" -dn Do not delete temporary files");
Write_Eol;
Write_Eol;
Write_Str (" --create-map-file Create map file mainprog.map");
Write_Eol;
@ -271,6 +265,9 @@ begin
Write_Str (" Create map file mapfile");
Write_Eol;
Write_Str (" --keep-temp-files Keep temporary files");
Write_Eol;
Write_Str (" --GCC=command Use this gcc command");
Write_Eol;

View File

@ -85,6 +85,10 @@ package Makeutl is
-- the builder and does not want to pollute its output with error messages
-- coming from the builder. This is an internal switch.
Keep_Temp_Files_Option : constant String := "--keep-temp-files";
-- Switch to suppress deletion of temp files created by the builder.
-- Equivallent of -dn.
Load_Standard_Base : Boolean := True;
-- False when gprbuild is called with --db-

View File

@ -843,9 +843,9 @@ package Opt is
-- sources until there is no more work.
Keep_Temporary_Files : Boolean := False;
-- GNATCMD
-- When True the temporary files created by the GNAT driver are not
-- deleted. Set by switch -dn or qualifier /KEEP_TEMPORARY_FILES.
-- GNATCMD, GNATMAKE, GPRBUILD
-- When True the temporary files are not deleted. Set by switches -dn or
-- --keep-temp-files.
Leap_Seconds_Support : Boolean := False;
-- GNATBIND

View File

@ -23,7 +23,6 @@
-- --
------------------------------------------------------------------------------
with Debug;
with Opt;
with Osint; use Osint;
with Output; use Output;
@ -187,7 +186,7 @@ package body Prj is
pragma Warnings (Off, Dont_Care);
begin
if not Debug.Debug_Flag_N then
if not Opt.Keep_Temporary_Files then
if Current_Verbosity = High then
Write_Line ("Removing temp file: " & Get_Name_String (Path));
end if;
@ -217,7 +216,7 @@ package body Prj is
Proj : Project_List;
begin
if not Debug.Debug_Flag_N then
if not Opt.Keep_Temporary_Files then
if Project_Tree /= null then
Proj := Project_Tree.Projects;
while Proj /= null loop
@ -254,7 +253,7 @@ package body Prj is
Path : Path_Name_Type;
begin
if not Debug.Debug_Flag_N then
if not Opt.Keep_Temporary_Files then
for Index in
1 .. Temp_Files_Table.Last (Shared.Private_Part.Temp_Files)
loop

View File

@ -1728,12 +1728,14 @@ package body Sem_Aggr is
Freeze_Before (N, E);
if Has_Dynamic_Predicate_Aspect (E) then
Error_Msg_NE ("subtype& has dynamic predicate,"
& "not allowed in aggregate choice", Choice, E);
Error_Msg_NE
("subtype& has dynamic predicate, not allowed "
& "in aggregate choice", Choice, E);
elsif not Is_Static_Subtype (E) then
Error_Msg_NE ("non-static subtype& has predicate,"
& "not allowed in aggregate choice", Choice, E);
Error_Msg_NE
("non-static subtype& has predicate, not allowed "
& "in aggregate choice", Choice, E);
end if;
-- If the subtype has a static predicate, replace the

View File

@ -2923,7 +2923,7 @@ package body Sem_Ch3 is
if Has_Dynamic_Predicate_Aspect (T) then
Error_Msg_N
("subtype has dynamic predicate, "
& "not allowed in number declaration", N);
& "not allowed in number declaration", N);
end if;
else

View File

@ -2210,9 +2210,9 @@ package body Sem_Ch5 is
or else Has_Dynamic_Predicate_Aspect (T))
then
Bad_Predicated_Subtype_Use
("cannot use subtype& with non-static predicate for loop " &
"iteration", Discrete_Subtype_Definition (N),
T, Suggest_Static => True);
("cannot use subtype& with non-static predicate for loop "
& "iteration", Discrete_Subtype_Definition (N),
T, Suggest_Static => True);
elsif Inside_A_Generic and then Is_Generic_Formal (T) then
Set_No_Dynamic_Predicate_On_Actual (T);

View File

@ -9819,10 +9819,9 @@ package body Sem_Res is
begin
if Nkind (Drange) = N_Subtype_Indication
and then Has_Predicates (Entity (Subtype_Mark (Drange)))
and then Has_Predicates (Entity (Subtype_Mark (Drange)))
then
Subt := Entity (Subtype_Mark (Drange));
else
Subt := Etype (Drange);
end if;

View File

@ -784,7 +784,6 @@ package body Sem_Util is
Gen : Entity_Id;
begin
-- Avoid cascaded errors
if Error_Posted (N) then

View File

@ -793,6 +793,9 @@ package body Switch.M is
elsif Switch_Chars = Makeutl.No_Exit_Message_Option then
Opt.No_Exit_Message := True;
elsif Switch_Chars = Makeutl.Keep_Temp_Files_Option then
Opt.Keep_Temporary_Files := True;
elsif Switch_Chars (Ptr) = '-' then
Bad_Switch (Switch_Chars);