From a30a69c1229cbf5270d2048299da5b9ae171e226 Mon Sep 17 00:00:00 2001 From: Yannick Moy Date: Wed, 26 Sep 2018 09:19:12 +0000 Subject: [PATCH] [Ada] Do not issue by default info messages for inlining in GNATprove Info messages about lack of inlining for analysis in GNATprove may be confusing to users. They are now only issued when GNATprove is called with switch --info, which it passes on to gnat2why with switch -gnatd_f. There is no effect on compilation. 2018-09-26 Yannick Moy gcc/ada/ * debug.adb: Add use for -gnatd_f switch. * inline.adb (Cannot_Inline): Only issue info message for failure to inline in GNATprove mode when switch -gnatd_f is used. From-SVN: r264629 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/debug.adb | 7 ++++++- gcc/ada/inline.adb | 21 ++++++++++++++------- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 16855a7d23f..0ba717d977a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Yannick Moy + + * debug.adb: Add use for -gnatd_f switch. + * inline.adb (Cannot_Inline): Only issue info message for + failure to inline in GNATprove mode when switch -gnatd_f is + used. + 2018-09-26 Javier Miranda * exp_disp.adb (Expand_Interface_Conversion): No displacement of diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 95efedeb25b..65451a2c18a 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -150,7 +150,7 @@ package body Debug is -- d_c -- d_d -- d_e Ignore entry calls and requeue statements for elaboration - -- d_f + -- d_f Issue info messages related to GNATprove usage -- d_g -- d_h -- d_i Ignore activations and calls to instances for elaboration @@ -831,6 +831,11 @@ package body Debug is -- control, conditional entry calls, timed entry calls, and requeue -- statements in both the static and dynamic elaboration models. + -- d_f Issue info messages related to GNATprove usage to help users + -- understand analysis results. By default these are not issued as + -- beginners find them confusing. Set automatically by GNATprove when + -- switch --info is used. + -- d_i The compiler ignores calls and task activations when they target a -- subprogram or task type defined in an external instance for both -- the static and dynamic elaboration models. diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 8f0b75d44a1..72991fad03e 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -1607,13 +1607,16 @@ package body Inline is then null; - -- In GNATprove mode, issue a warning, and indicate that the - -- subprogram is not always inlined by setting flag Is_Inlined_Always - -- to False. + -- In GNATprove mode, issue a warning when -gnatd_f is set, and + -- indicate that the subprogram is not always inlined by setting + -- flag Is_Inlined_Always to False. elsif GNATprove_Mode then Set_Is_Inlined_Always (Subp, False); - Error_Msg_NE (Msg & "p?", N, Subp); + + if Debug_Flag_Underscore_F then + Error_Msg_NE (Msg & "p?", N, Subp); + end if; elsif Has_Pragma_Inline_Always (Subp) then @@ -1634,12 +1637,16 @@ package body Inline is Error_Msg_NE (Msg (Msg'First .. Msg'Last - 1), N, Subp); - -- In GNATprove mode, issue a warning, and indicate that the subprogram - -- is not always inlined by setting flag Is_Inlined_Always to False. + -- In GNATprove mode, issue a warning when -gnatd_f is set, and + -- indicate that the subprogram is not always inlined by setting + -- flag Is_Inlined_Always to False. elsif GNATprove_Mode then Set_Is_Inlined_Always (Subp, False); - Error_Msg_NE (Msg & "p?", N, Subp); + + if Debug_Flag_Underscore_F then + Error_Msg_NE (Msg & "p?", N, Subp); + end if; else -- 2.30.2