Hello!

> Similarly to what Gaby did in 2013 for C++
> (<https://gcc.gnu.org/ml/gcc-patches/2013-03/msg01271.html>), this patch
> makes the c/ and c-family/ code use VAR_P rather than
>
>   TREE_CODE (t) == VAR_DECL
>
> (This is on top of the previous patch with is_global_var.)

You could also use VAR_OR_FUNCTION_DECL, e.g. in the part below.

Uros.

@@ -7378,14 +7378,13 @@ handle_unused_attribute (tree *node, tree
name, tree ARG_UNUSED (args),
       tree decl = *node;

       if (TREE_CODE (decl) == PARM_DECL
-  || TREE_CODE (decl) == VAR_DECL
+  || VAR_P (decl)
   || TREE_CODE (decl) == FUNCTION_DECL
   || TREE_CODE (decl) == LABEL_DECL
   || TREE_CODE (decl) == TYPE_DECL)

Reply via email to