+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 ...
-- 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
-- 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
-- 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;
-- 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"
-- 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)
-- 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="
Project_Of_Current_Object_Directory := No_Project;
+ if Debug.Debug_Flag_N then
+ Opt.Keep_Temporary_Files := True;
+ end if;
end Initialize;
----------------------------
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;
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;
-- 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-
-- 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
-- --
------------------------------------------------------------------------------
-with Debug;
with Opt;
with Osint; use Osint;
with Output; use Output;
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;
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
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
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
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
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);
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;
Gen : Entity_Id;
begin
-
-- Avoid cascaded errors
if Error_Posted (N) then
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);