ada: Add support for per-location warning groups.
authorMartin Sebor <msebor@redhat.com>
Mon, 28 Jun 2021 20:18:06 +0000 (14:18 -0600)
committerMartin Sebor <msebor@redhat.com>
Mon, 28 Jun 2021 20:18:06 +0000 (14:18 -0600)
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.

gcc/ada/gcc-interface/trans.c
gcc/ada/gcc-interface/utils.c

index feb3a7e..6a7424f 100644 (file)
@@ -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);
index 1786fbf..982274c 100644 (file)
@@ -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))