public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1857] ada: Add support for per-location warning groups.
@ 2021-06-28 21:20 Martin Sebor
  0 siblings, 0 replies; only message in thread
From: Martin Sebor @ 2021-06-28 21:20 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8c7dfbb8f3d55be6bed27a6889ebae30c0e7a044

commit r12-1857-g8c7dfbb8f3d55be6bed27a6889ebae30c0e7a044
Author: Martin Sebor <msebor@redhat.com>
Date:   Mon Jun 28 14:18:06 2021 -0600

    ada: Add support for per-location warning groups.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
            Replace TREE_NO_WARNING with suppress_warning.
            (gnat_gimplify_expr): Same.
            * gcc-interface/utils.c (gnat_pushdecl): Same.

Diff:
---
 gcc/ada/gcc-interface/trans.c | 4 ++--
 gcc/ada/gcc-interface/utils.c | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index feb3a7e15c4..6a7424fecbd 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -5363,7 +5363,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
 	 because of the unstructured form of EH used by fe_sjlj_eh, there
 	 might be forward edges going to __builtin_setjmp receivers on which
 	 it is uninitialized, although they will never be actually taken.  */
-      TREE_NO_WARNING (gnu_jmpsave_decl) = 1;
+      suppress_warning (gnu_jmpsave_decl, OPT_Wuninitialized);
       gnu_jmpbuf_decl
 	= create_var_decl (get_identifier ("JMP_BUF"), NULL_TREE,
 			   jmpbuf_type,
@@ -8805,7 +8805,7 @@ gnat_gimplify_expr (tree *expr_p, gimple_seq *pre_p,
       else
 	{
 	  *expr_p = create_tmp_var (type, NULL);
-	  TREE_NO_WARNING (*expr_p) = 1;
+	  suppress_warning (*expr_p);
 	}
 
       gimplify_and_add (TREE_OPERAND (expr, 0), pre_p);
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 1786fbf8186..982274c6d77 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -836,7 +836,8 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
   if (!deferred_decl_context)
     DECL_CONTEXT (decl) = context;
 
-  TREE_NO_WARNING (decl) = (No (gnat_node) || Warnings_Off (gnat_node));
+  suppress_warning (decl, all_warnings,
+		    No (gnat_node) || Warnings_Off (gnat_node));
 
   /* Set the location of DECL and emit a declaration for it.  */
   if (Present (gnat_node) && !renaming_from_instantiation_p (gnat_node))


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-28 21:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 21:20 [gcc r12-1857] ada: Add support for per-location warning groups Martin Sebor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).