From 3849c2468667a5f15e6dae5ec9ef8a8d4d99cba2 Mon Sep 17 00:00:00 2001 From: Vincent Celier Date: Fri, 1 Aug 2014 08:34:02 +0000 Subject: [PATCH] debug.adb: Remove doc for gnatmake/gprbuild switch -ds. 2014-08-01 Vincent Celier * debug.adb: Remove doc for gnatmake/gprbuild switch -ds. * make.adb (List_Bad_Compilations): Use Opt.No_Exit_Message instead of Debug.Debug_Flag_S. * makeutl.adb (Finish_Program, Fail_Program): Use Opt flag No_Exit_Message instead of Debug.Debug_Flag_S to suppress exit error messages. * makeutl.ads (No_Exit_Message_Option): New constant string for switch --no-exit-message. * opt.ads (No_Exit_Message): New Boolean flag, defaulted to False. * switch-m.adb (Scan_Make_Switches): Recognize new switch --no-exit-message. From-SVN: r213424 --- gcc/ada/ChangeLog | 14 ++++++++++++++ gcc/ada/debug.adb | 10 +--------- gcc/ada/make.adb | 2 +- gcc/ada/makeutl.adb | 6 +++--- gcc/ada/makeutl.ads | 6 ++++++ gcc/ada/opt.ads | 5 +++++ gcc/ada/switch-m.adb | 5 ++++- 7 files changed, 34 insertions(+), 14 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6069ea63f61..502df3ef0f3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,17 @@ +2014-08-01 Vincent Celier + + * debug.adb: Remove doc for gnatmake/gprbuild switch -ds. + * make.adb (List_Bad_Compilations): Use Opt.No_Exit_Message + instead of Debug.Debug_Flag_S. + * makeutl.adb (Finish_Program, Fail_Program): Use Opt flag + No_Exit_Message instead of Debug.Debug_Flag_S to suppress exit + error messages. + * makeutl.ads (No_Exit_Message_Option): New constant string + for switch --no-exit-message. + * opt.ads (No_Exit_Message): New Boolean flag, defaulted to False. + * switch-m.adb (Scan_Make_Switches): Recognize new switch + --no-exit-message. + 2014-08-01 Arnaud Charlet * exp_vfpt.adb, exp_vfpt.ads: Removed, no longer used. diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index de649f4a70e..94da8ec7db8 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -214,7 +214,7 @@ package body Debug is -- dp Prints the contents of the Q used by Make.Compile_Sources -- dq Prints source files as they are enqueued and dequeued -- dr - -- ds Suppress exit message when compilation fails + -- ds -- dt Display time stamps when there is a mismatch -- du List units as their ali files are acquired -- dv @@ -801,10 +801,6 @@ package body Debug is -- used by routine Make.Compile_Sources. Useful to figure out the -- order in which sources are recompiled. - -- ds When one or more compilations compilation fail, gnatmake does not - -- issue an error message such as: - -- gnatmake: "/path/to/main.adb" compilation error - -- dt When a time stamp mismatch has been found for an ALI file, -- display the source file name, the time stamp expected and -- the time stamp found. @@ -824,10 +820,6 @@ package body Debug is -- of execution, such as temporary config pragma files, mapping -- files or project path files. - -- ds When one or more compilations compilation fail, gprbuild does not - -- issue the error message: - -- gprbuild: *** compilation phase failed - -- dt When a time stamp mismatch has been found for an ALI file, -- display the source file name, the time stamp expected and -- the time stamp found. diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index 808ad006743..05cb6f14308 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -6948,7 +6948,7 @@ package body Make is procedure List_Bad_Compilations is begin - if not Debug.Debug_Flag_S then + if not No_Exit_Message then for J in Bad_Compilation.First .. Bad_Compilation.Last loop if Bad_Compilation.Table (J).File = No_File then null; diff --git a/gcc/ada/makeutl.adb b/gcc/ada/makeutl.adb index a988c6a0bcc..9dde6cb0194 100644 --- a/gcc/ada/makeutl.adb +++ b/gcc/ada/makeutl.adb @@ -777,7 +777,7 @@ package body Makeutl is Flush_Messages : Boolean := True) is begin - if Flush_Messages and then not Debug.Debug_Flag_S then + if Flush_Messages and then not No_Exit_Message then if Total_Errors_Detected /= 0 or else Warnings_Detected /= 0 then Errutil.Finalize; end if; @@ -806,13 +806,13 @@ package body Makeutl is if S'Length > 0 then if Exit_Code /= E_Success then - if Debug.Debug_Flag_S then + if No_Exit_Message then Osint.Exit_Program (E_Fatal); else Osint.Fail (S); end if; - elsif not Debug.Debug_Flag_S then + elsif not No_Exit_Message then Write_Str (S); end if; end if; diff --git a/gcc/ada/makeutl.ads b/gcc/ada/makeutl.ads index ab8068bd22c..ff7b492db7f 100644 --- a/gcc/ada/makeutl.ads +++ b/gcc/ada/makeutl.ads @@ -79,6 +79,12 @@ package Makeutl is Create_Map_File_Switch : constant String := "--create-map-file"; -- Switch to create a map file when an executable is linked + No_Exit_Message_Option : constant String := "--no-exit-message"; + -- Switch to suppress exit error message when there are compilation + -- failures. This is useful when a tool, such as gnatprove, call silently + -- the builder and do not want to pollute its output with error messages + -- coming from the builder. This is an internal switch. + Load_Standard_Base : Boolean := True; -- False when gprbuild is called with --db- diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 6f79fc12fb9..bdbdf0aa0a6 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -1938,6 +1938,11 @@ package Opt is -- This switch is not set when the pragma appears ahead of a given -- unit, so it does not affect the compilation of other units. + No_Exit_Message : Boolean := False; + -- GNATMAKE, GPRBUILD + -- Set with switch --no-exit-message. When True, if there are compilation + -- failure, the builder does not issue an exit error message. + Optimize_Alignment_Config : Character; -- GNAT -- This is the value of the configuration switch that controls the diff --git a/gcc/ada/switch-m.adb b/gcc/ada/switch-m.adb index 575b1aad634..aba22230522 100644 --- a/gcc/ada/switch-m.adb +++ b/gcc/ada/switch-m.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -790,6 +790,9 @@ package body Switch.M is elsif Switch_Chars = Makeutl.Single_Compile_Per_Obj_Dir_Switch then Opt.One_Compilation_Per_Obj_Dir := True; + elsif Switch_Chars = Makeutl.No_Exit_Message_Option then + Opt.No_Exit_Message := True; + elsif Switch_Chars (Ptr) = '-' then Bad_Switch (Switch_Chars);