From: Guillaume Gomez <[email protected]>
gcc/ada/ChangeLog:
* gcc-interface/utils.cc: Rename common attribute handlers.
gcc/ChangeLog:
* attr-handlers.cc (handle_alias_ifunc_attribute)
(common_handle_alias_ifunc_attribute)
(handle_leaf_attribute, common_handle_leaf_attribute)
(handle_const_attribute, common_handle_const_attribute)
(handle_pure_attribute, common_handle_pure_attribute)
(handle_novops_attribute, common_handle_novops_attribute)
(handle_nothrow_attribute, common_handle_nothrow_attribute)
(handle_type_generic_attribute, common_handle_type_generic_attribute)
(handle_returns_twice_attribute, common_handle_returns_twice_attribute)
(handle_fnspec_attribute, common_handle_fnspec_attribute)
(handle_visibility_attribute, common_handle_visibility_attribute)
(handle_always_inline_attribute, common_handle_always_inline_attribute)
(handle_noinline_attribute, common_handle_noinline_attribute)
(handle_weak_attribute, common_handle_weak_attribute)
(handle_target_attribute, common_handle_target_attribute)
(handle_used_attribute, common_handle_used_attribute)
(handle_alias_attribute, common_handle_alias_attribute)
(handle_section_attribute, common_handle_section_attribute)
(handle_retain_attribute, common_handle_retain_attribute)
(handle_malloc_common, common_handle_malloc_common): Rename common
attribute handlers.
* attr-handlers.h (handle_alias_ifunc_attribute, handle_malloc_common)
(handle_alias_attribute, handle_always_inline_attribute)
(handle_const_attribute, handle_fnspec_attribute, handle_leaf_attribute)
(handle_noinline_attribute, handle_nothrow_attribute)
(handle_novops_attribute, handle_pure_attribute,
handle_retain_attribute)
(handle_returns_twice_attribute, handle_section_attribute)
(handle_target_attribute, handle_type_generic_attribute)
(handle_used_attribute, handle_visibility_attribute)
(handle_weak_attribute, common_handle_alias_ifunc_attribute)
(common_handle_malloc_common, common_handle_alias_attribute)
(common_handle_always_inline_attribute, common_handle_const_attribute)
(common_handle_fnspec_attribute, common_handle_leaf_attribute)
(common_handle_noinline_attribute, common_handle_nothrow_attribute)
(common_handle_novops_attribute, common_handle_pure_attribute)
(common_handle_retain_attribute, common_handle_returns_twice_attribute)
(common_handle_section_attribute, common_handle_target_attribute)
(common_handle_type_generic_attribute, common_handle_used_attribute)
(common_handle_visibility_attribute, common_handle_weak_attribute):
Rename common attribute handlers.
gcc/c-family/ChangeLog:
* c-attribs.cc (handle_ifunc_attribute, handle_malloc_attribute): Rename
common attribute handlers.
gcc/d/ChangeLog:
* d-attribs.cc: Rename common attribute handlers.
gcc/jit/ChangeLog:
* dummy-frontend.cc: Rename common attribute handlers.
gcc/rust/ChangeLog:
* rust-attribs.cc: Rename common attribute handlers.
---
Follow-up of #275, #274 and #273.
Trevor Saunders suggested to rename the common attribute handlers rather than
in each front-end. Which is indeed better. So here is this patch. I only
renamed the common attributes and didn't revert the 3 mentioned PRs above but
if reviewers prefer, I can also revert the attribute handlers in the front-ends.
cc @cohenarthur @ibuclaw @dmalcolm
This is a forge pull request published on the gcc-patches mailing list mailing
list
as requested by Guillaume Gomez via Sourceware Forge
<[email protected]>.
Forge discussion: https://forge.sourceware.org/gcc/gcc/pulls/277
Get it locally using:
```
git fetch forge-upstream "+refs/versioned_pull/277/*:refs/versioned_pull/277/*"
git switch -c "pr-277-v1" "refs/versioned_pull/277/1/head"
```
Or, download the patch at: https://forge.sourceware.org/gcc/gcc/pulls/277.diff
Created on: 2026-11-13 16:44:02+00:00
Latest update: 2026-11-13 17:22:32+00:00
Changes: 7 changed files, 134 additions, 122 deletions
Head revision: imperio/gcc ref rename-common-attr-handlers commit
fe781daf7b8d88f433797114a47cc01ff2ed8504
Base revision: gcc/gcc ref trunk commit
5417ceaa41c63fc747833a71111e7578bebcad20 r17-6231-g5417ceaa41c63f
Merge base: 5417ceaa41c63fc747833a71111e7578bebcad20
Requested Reviewers:
Changed files:
- M: gcc/ada/gcc-interface/utils.cc
- M: gcc/attr-handlers.cc
- M: gcc/attr-handlers.h
- M: gcc/c-family/c-attribs.cc
- M: gcc/d/d-attribs.cc
- M: gcc/jit/dummy-frontend.cc
- M: gcc/rust/rust-attribs.cc
gcc/ada/gcc-interface/utils.cc | 12 ++--
gcc/attr-handlers.cc | 100 +++++++++++++++++----------------
gcc/attr-handlers.h | 43 +++++++-------
gcc/c-family/c-attribs.cc | 40 ++++++-------
gcc/d/d-attribs.cc | 21 +++----
gcc/jit/dummy-frontend.cc | 34 +++++------
gcc/rust/rust-attribs.cc | 6 +-
7 files changed, 134 insertions(+), 122 deletions(-)
diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index 11ef1e6c966d5..46b13dc24b363 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -152,7 +152,7 @@ static const attribute_spec gnat_internal_attributes[] =
{ "pure", 0, 0, true, false, false, false,
ada_handle_pure_attribute, NULL },
{ "no vops", 0, 0, true, false, false, false,
- handle_novops_attribute, NULL },
+ common_handle_novops_attribute, NULL },
{ "nonnull", 0, -1, false, true, true, false,
ada_handle_nonnull_attribute, NULL },
{ "sentinel", 0, 1, false, true, true, false,
@@ -168,7 +168,7 @@ static const attribute_spec gnat_internal_attributes[] =
{ "strub", 0, 1, false, true, false, true,
ada_handle_strub_attribute, NULL },
{ "noinline", 0, 0, true, false, false, false,
- handle_noinline_attribute, attr_noinline_exclusions },
+ common_handle_noinline_attribute, attr_noinline_exclusions },
{ "noclone", 0, 0, true, false, false, false,
ada_handle_noclone_attribute, NULL },
{ "no_icf", 0, 0, true, false, false, false,
@@ -178,16 +178,16 @@ static const attribute_spec gnat_internal_attributes[] =
{ "leaf", 0, 0, true, false, false, false,
ada_handle_leaf_attribute, NULL },
{ "always_inline",0, 0, true, false, false, false,
- handle_always_inline_attribute, attr_always_inline_exclusions },
+ common_handle_always_inline_attribute, attr_always_inline_exclusions },
{ "malloc", 0, 0, true, false, false, false,
ada_handle_malloc_attribute, NULL },
{ "type generic", 0, 0, false, true, true, false,
- handle_type_generic_attribute, NULL },
+ common_handle_type_generic_attribute, NULL },
{ "flatten", 0, 0, true, false, false, false,
ada_handle_flatten_attribute, NULL },
{ "used", 0, 0, true, false, false, false,
- handle_used_attribute, NULL },
+ common_handle_used_attribute, NULL },
{ "uninitialized",0, 0, true, false, false, false,
ada_handle_uninitialized_attribute, NULL },
{ "cold", 0, 0, true, false, false, false,
@@ -197,7 +197,7 @@ static const attribute_spec gnat_internal_attributes[] =
{ "simd", 0, 1, true, false, false, false,
ada_handle_simd_attribute, NULL },
{ "target", 1, -1, true, false, false, false,
- handle_target_attribute, attr_target_exclusions },
+ common_handle_target_attribute, attr_target_exclusions },
{ "target_clones",1, -1, true, false, false, false,
ada_handle_target_clones_attribute, attr_target_clones_exclusions },
diff --git a/gcc/attr-handlers.cc b/gcc/attr-handlers.cc
index 103f2aab65754..645745432e88d 100644
--- a/gcc/attr-handlers.cc
+++ b/gcc/attr-handlers.cc
@@ -250,8 +250,8 @@ validate_attr_arg (tree node[2], tree name, tree newarg)
whether this is an alias as opposed to ifunc attribute. */
tree
-handle_alias_ifunc_attribute (bool is_alias, tree *node, tree name, tree args,
- bool *no_add_attrs)
+common_handle_alias_ifunc_attribute (bool is_alias, tree *node, tree name,
+ tree args, bool *no_add_attrs)
{
tree decl = *node;
@@ -350,9 +350,8 @@ ignore_attribute (tree * ARG_UNUSED (node), tree ARG_UNUSED
(name),
struct attribute_spec.handler. */
tree
-handle_leaf_attribute (tree *node, tree name,
- tree ARG_UNUSED (args),
- int ARG_UNUSED (flags), bool *no_add_attrs)
+common_handle_leaf_attribute (tree *node, tree name, tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags), bool *no_add_attrs)
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
@@ -373,8 +372,8 @@ handle_leaf_attribute (tree *node, tree name,
struct attribute_spec.handler. */
tree
-handle_const_attribute (tree *node, tree name, tree ARG_UNUSED (args),
- int flags, bool *no_add_attrs)
+common_handle_const_attribute (tree *node, tree name, tree ARG_UNUSED (args),
+ int flags, bool *no_add_attrs)
{
tree type = TREE_TYPE (*node);
@@ -410,8 +409,8 @@ handle_const_attribute (tree *node, tree name, tree
ARG_UNUSED (args),
struct attribute_spec.handler. */
tree
-handle_pure_attribute (tree *node, tree name, tree ARG_UNUSED (args),
- int ARG_UNUSED (flags), bool *no_add_attrs)
+common_handle_pure_attribute (tree *node, tree name, tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags), bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
{
@@ -436,9 +435,9 @@ handle_pure_attribute (tree *node, tree name, tree
ARG_UNUSED (args),
struct attribute_spec.handler. */
tree
-handle_novops_attribute (tree *node, tree ARG_UNUSED (name),
- tree ARG_UNUSED (args), int ARG_UNUSED (flags),
- bool *ARG_UNUSED (no_add_attrs))
+common_handle_novops_attribute (tree *node, tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args), int ARG_UNUSED (flags),
+ bool *ARG_UNUSED (no_add_attrs))
{
gcc_assert (TREE_CODE (*node) == FUNCTION_DECL);
DECL_IS_NOVOPS (*node) = 1;
@@ -449,8 +448,8 @@ handle_novops_attribute (tree *node, tree ARG_UNUSED (name),
struct attribute_spec.handler. */
tree
-handle_nothrow_attribute (tree *node, tree name, tree ARG_UNUSED (args),
- int ARG_UNUSED (flags), bool *no_add_attrs)
+common_handle_nothrow_attribute (tree *node, tree name, tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags), bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
TREE_NOTHROW (*node) = 1;
@@ -467,9 +466,10 @@ handle_nothrow_attribute (tree *node, tree name, tree
ARG_UNUSED (args),
/* Handle a "type_generic" attribute. */
tree
-handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name),
- tree ARG_UNUSED (args), int ARG_UNUSED (flags),
- bool * ARG_UNUSED (no_add_attrs))
+common_handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
{
/* Ensure we have a function type. */
gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE);
@@ -483,8 +483,10 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED
(name),
/* Handle a "returns_twice" attribute. */
tree
-handle_returns_twice_attribute (tree *node, tree name, tree ARG_UNUSED (args),
- int ARG_UNUSED (flags), bool *no_add_attrs)
+common_handle_returns_twice_attribute (tree *node, tree name,
+ tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags),
+ bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
DECL_IS_RETURNS_TWICE (*node) = 1;
@@ -501,9 +503,10 @@ handle_returns_twice_attribute (tree *node, tree name,
tree ARG_UNUSED (args),
struct attribute_spec.handler. */
tree
-handle_fnspec_attribute (tree *node ATTRIBUTE_UNUSED, tree ARG_UNUSED (name),
- tree args, int ARG_UNUSED (flags),
- bool *no_add_attrs ATTRIBUTE_UNUSED)
+common_handle_fnspec_attribute (tree *node ATTRIBUTE_UNUSED,
+ tree ARG_UNUSED (name), tree args,
+ int ARG_UNUSED (flags),
+ bool *no_add_attrs ATTRIBUTE_UNUSED)
{
gcc_assert (args
&& TREE_CODE (TREE_VALUE (args)) == STRING_CST
@@ -515,9 +518,9 @@ handle_fnspec_attribute (tree *node ATTRIBUTE_UNUSED, tree
ARG_UNUSED (name),
struct attribute_spec.handler. */
tree
-handle_visibility_attribute (tree *node, tree name, tree args,
- int ARG_UNUSED (flags),
- bool *ARG_UNUSED (no_add_attrs))
+common_handle_visibility_attribute (tree *node, tree name, tree args,
+ int ARG_UNUSED (flags),
+ bool *ARG_UNUSED (no_add_attrs))
{
tree decl = *node;
tree id = TREE_VALUE (args);
@@ -614,10 +617,10 @@ handle_visibility_attribute (tree *node, tree name, tree
args,
struct attribute_spec.handler. */
tree
-handle_always_inline_attribute (tree *node, tree name,
- tree ARG_UNUSED (args),
- int ARG_UNUSED (flags),
- bool *no_add_attrs)
+common_handle_always_inline_attribute (tree *node, tree name,
+ tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags),
+ bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
{
@@ -638,9 +641,8 @@ handle_always_inline_attribute (tree *node, tree name,
struct attribute_spec.handler. */
tree
-handle_noinline_attribute (tree *node, tree name,
- tree ARG_UNUSED (args),
- int ARG_UNUSED (flags), bool *no_add_attrs)
+common_handle_noinline_attribute (tree *node, tree name, tree ARG_UNUSED
(args),
+ int ARG_UNUSED (flags), bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
DECL_UNINLINABLE (*node) = 1;
@@ -657,10 +659,9 @@ handle_noinline_attribute (tree *node, tree name,
struct attribute_spec.handler. */
tree
-handle_weak_attribute (tree *node, tree name,
- tree ARG_UNUSED (args),
- int ARG_UNUSED (flags),
- bool * ARG_UNUSED (no_add_attrs))
+common_handle_weak_attribute (tree *node, tree name, tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
{
if (TREE_CODE (*node) == FUNCTION_DECL
&& DECL_DECLARED_INLINE_P (*node))
@@ -685,8 +686,8 @@ handle_weak_attribute (tree *node, tree name,
/* Handle a "target" attribute. */
tree
-handle_target_attribute (tree *node, tree name, tree args, int flags,
- bool *no_add_attrs)
+common_handle_target_attribute (tree *node, tree name, tree args, int flags,
+ bool *no_add_attrs)
{
/* Ensure we have a function declaration. */
if (TREE_CODE (*node) != FUNCTION_DECL)
@@ -718,8 +719,8 @@ handle_target_attribute (tree *node, tree name, tree args,
int flags,
struct attribute_spec.handler. */
tree
-handle_used_attribute (tree *pnode, tree name, tree ARG_UNUSED (args),
- int ARG_UNUSED (flags), bool *no_add_attrs)
+common_handle_used_attribute (tree *pnode, tree name, tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags), bool *no_add_attrs)
{
tree node = *pnode;
@@ -745,18 +746,19 @@ handle_used_attribute (tree *pnode, tree name, tree
ARG_UNUSED (args),
struct attribute_spec.handler. */
tree
-handle_alias_attribute (tree *node, tree name, tree args,
- int ARG_UNUSED (flags), bool *no_add_attrs)
+common_handle_alias_attribute (tree *node, tree name, tree args,
+ int ARG_UNUSED (flags), bool *no_add_attrs)
{
- return handle_alias_ifunc_attribute (true, node, name, args, no_add_attrs);
+ return common_handle_alias_ifunc_attribute (true, node, name, args,
+ no_add_attrs);
}
/* Handle a "section" attribute; arguments as in
struct attribute_spec.handler. */
tree
-handle_section_attribute (tree *node, tree name, tree args,
- int flags, bool *no_add_attrs)
+common_handle_section_attribute (tree *node, tree name, tree args, int flags,
+ bool *no_add_attrs)
{
tree decl = *node;
tree res = NULL_TREE;
@@ -834,8 +836,8 @@ fail:
struct attribute_spec.handler. */
tree
-handle_retain_attribute (tree *pnode, tree name, tree ARG_UNUSED (args),
- int ARG_UNUSED (flags), bool *no_add_attrs)
+common_handle_retain_attribute (tree *pnode, tree name, tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags), bool *no_add_attrs)
{
tree node = *pnode;
@@ -856,8 +858,8 @@ handle_retain_attribute (tree *pnode, tree name, tree
ARG_UNUSED (args),
the C-family front-end. */
tree
-handle_malloc_common (tree *node, tree name, tree ARG_UNUSED (args),
- int ARG_UNUSED (flags), bool *no_add_attrs)
+common_handle_malloc_common (tree *node, tree name, tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags), bool *no_add_attrs)
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
diff --git a/gcc/attr-handlers.h b/gcc/attr-handlers.h
index 5e0dc2f6bb8ac..cdd76cdd18af8 100644
--- a/gcc/attr-handlers.h
+++ b/gcc/attr-handlers.h
@@ -36,25 +36,30 @@ extern bool validate_attr_args (tree node[2], tree name,
tree newargs[2]);
extern bool validate_attr_arg (tree node[2], tree name, tree newarg);
/* Attribute handlers. */
-extern tree handle_alias_ifunc_attribute (bool, tree *, tree, tree, bool *);
-extern tree handle_malloc_common (tree *, tree, tree, int, bool *);
-extern tree handle_alias_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_always_inline_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_const_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_fnspec_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_leaf_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_noinline_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_nothrow_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_novops_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_pure_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_retain_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_returns_twice_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_section_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_target_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_type_generic_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_used_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_visibility_attribute (tree *, tree, tree, int, bool *);
-extern tree handle_weak_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_alias_ifunc_attribute (bool, tree *, tree, tree,
+ bool *);
+extern tree common_handle_malloc_common (tree *, tree, tree, int, bool *);
+extern tree common_handle_alias_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_always_inline_attribute (tree *, tree, tree, int,
+ bool *);
+extern tree common_handle_const_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_fnspec_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_leaf_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_noinline_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_nothrow_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_novops_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_pure_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_retain_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_returns_twice_attribute (tree *, tree, tree, int,
+ bool *);
+extern tree common_handle_section_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_target_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_type_generic_attribute (tree *, tree, tree, int,
+ bool *);
+extern tree common_handle_used_attribute (tree *, tree, tree, int, bool *);
+extern tree common_handle_visibility_attribute (tree *, tree, tree, int,
+ bool *);
+extern tree common_handle_weak_attribute (tree *, tree, tree, int, bool *);
extern tree ignore_attribute (tree *, tree, tree, int, bool *);
#endif // GCC_ATTR_HANDLERS_H
diff --git a/gcc/c-family/c-attribs.cc b/gcc/c-family/c-attribs.cc
index 5d45a345d26c0..e818f956847c8 100644
--- a/gcc/c-family/c-attribs.cc
+++ b/gcc/c-family/c-attribs.cc
@@ -292,7 +292,7 @@ const struct attribute_spec c_common_gnu_attributes[] =
{ "strub", 0, 1, false, true, false, true,
handle_strub_attribute, NULL },
{ "noinline", 0, 0, true, false, false, false,
- handle_noinline_attribute,
+ common_handle_noinline_attribute,
attr_noinline_exclusions },
{ "noclone", 0, 0, true, false, false, false,
handle_noclone_attribute, NULL },
@@ -301,9 +301,9 @@ const struct attribute_spec c_common_gnu_attributes[] =
{ "noipa", 0, 0, true, false, false, false,
handle_noipa_attribute, NULL },
{ "leaf", 0, 0, true, false, false, false,
- handle_leaf_attribute, NULL },
+ common_handle_leaf_attribute, NULL },
{ "always_inline", 0, 0, true, false, false, false,
- handle_always_inline_attribute,
+ common_handle_always_inline_attribute,
attr_always_inline_exclusions },
{ "gnu_inline", 0, 0, true, false, false, false,
handle_gnu_inline_attribute,
@@ -313,20 +313,20 @@ const struct attribute_spec c_common_gnu_attributes[] =
{ "flatten", 0, 0, true, false, false, false,
handle_flatten_attribute, NULL },
{ "used", 0, 0, true, false, false, false,
- handle_used_attribute, NULL },
+ common_handle_used_attribute, NULL },
{ "unused", 0, 0, false, false, false, false,
handle_unused_attribute, NULL },
{ "uninitialized", 0, 0, true, false, false, false,
handle_uninitialized_attribute, NULL },
{ "retain", 0, 0, true, false, false, false,
- handle_retain_attribute, NULL },
+ common_handle_retain_attribute, NULL },
{ "externally_visible", 0, 0, true, false, false, false,
handle_externally_visible_attribute, NULL },
{ "no_reorder", 0, 0, true, false, false, false,
handle_no_reorder_attribute, NULL },
/* The same comments as for noreturn attributes apply to const ones. */
{ "const", 0, 0, true, false, false, false,
- handle_const_attribute,
+ common_handle_const_attribute,
attr_const_pure_exclusions },
{ "scalar_storage_order", 1, 1, false, false, false, false,
handle_scalar_storage_order_attribute, NULL },
@@ -339,7 +339,8 @@ const struct attribute_spec c_common_gnu_attributes[] =
{ "mode", 1, 1, false, true, false, false,
handle_mode_attribute, NULL },
{ "section", 1, 1, true, false, false, false,
- handle_section_attribute, attr_section_exclusions
},
+ common_handle_section_attribute,
+ attr_section_exclusions },
{ "aligned", 0, 1, false, false, false, false,
handle_aligned_attribute,
attr_aligned_exclusions },
@@ -350,13 +351,13 @@ const struct attribute_spec c_common_gnu_attributes[] =
{ "counted_by", 1, 1, true, false, false, false,
handle_counted_by_attribute, NULL },
{ "weak", 0, 0, true, false, false, false,
- handle_weak_attribute, NULL },
+ common_handle_weak_attribute, NULL },
{ "noplt", 0, 0, true, false, false, false,
handle_noplt_attribute, NULL },
{ "ifunc", 1, 1, true, false, false, false,
handle_ifunc_attribute, NULL },
{ "alias", 1, 1, true, false, false, false,
- handle_alias_attribute, NULL },
+ common_handle_alias_attribute, NULL },
{ "weakref", 0, 1, true, false, false, false,
handle_weakref_attribute, NULL },
{ "no_instrument_function", 0, 0, true, false, false, false,
@@ -368,12 +369,12 @@ const struct attribute_spec c_common_gnu_attributes[] =
{ "malloc", 0, 2, true, false, false, false,
handle_malloc_attribute, attr_alloc_exclusions },
{ "returns_twice", 0, 0, true, false, false, false,
- handle_returns_twice_attribute,
+ common_handle_returns_twice_attribute,
attr_returns_twice_exclusions },
{ "no_stack_limit", 0, 0, true, false, false, false,
handle_no_limit_stack_attribute, NULL },
{ "pure", 0, 0, true, false, false, false,
- handle_pure_attribute,
+ common_handle_pure_attribute,
attr_const_pure_exclusions },
{ "reproducible", 0, 0, false, true, true, false,
handle_reproducible_attribute, NULL },
@@ -404,7 +405,7 @@ const struct attribute_spec c_common_gnu_attributes[] =
/* For internal use (marking of builtins) only. The name contains space
to prevent its usage in source code. */
{ "no vops", 0, 0, true, false, false, false,
- handle_novops_attribute, NULL },
+ common_handle_novops_attribute, NULL },
{ "deprecated", 0, 1, false, false, false, false,
handle_deprecated_attribute, NULL },
{ "unavailable", 0, 1, false, false, false, false,
@@ -414,7 +415,7 @@ const struct attribute_spec c_common_gnu_attributes[] =
{ "vector_mask", 0, 0, false, true, false, true,
handle_vector_mask_attribute, NULL },
{ "visibility", 1, 1, false, false, false, false,
- handle_visibility_attribute, NULL },
+ common_handle_visibility_attribute, NULL },
{ "tls_model", 1, 1, true, false, false, false,
handle_tls_model_attribute, NULL },
{ "nonnull", 0, -1, false, true, true, false,
@@ -424,7 +425,7 @@ const struct attribute_spec c_common_gnu_attributes[] =
{ "nonstring", 0, 0, true, false, false, false,
handle_nonstring_attribute, NULL },
{ "nothrow", 0, 0, true, false, false, false,
- handle_nothrow_attribute, NULL },
+ common_handle_nothrow_attribute, NULL },
{ "expected_throw", 0, 0, true, false, false, false,
handle_expected_throw_attribute, NULL },
{ "may_alias", 0, 0, false, true, false, false, NULL, NULL },
@@ -438,7 +439,7 @@ const struct attribute_spec c_common_gnu_attributes[] =
/* For internal use (marking of builtins) only. The name contains space
to prevent its usage in source code. */
{ "type generic", 0, 0, false, true, true, false,
- handle_type_generic_attribute, NULL },
+ common_handle_type_generic_attribute, NULL },
{ "alloc_size", 1, 2, false, true, true, false,
handle_alloc_size_attribute,
attr_alloc_exclusions },
@@ -469,7 +470,7 @@ const struct attribute_spec c_common_gnu_attributes[] =
{ "error", 1, 1, true, false, false, false,
handle_error_attribute, NULL },
{ "target", 1, -1, true, false, false, false,
- handle_target_attribute,
+ common_handle_target_attribute,
attr_target_exclusions },
{ "target_version", 1, 1, true, false, false, false,
handle_target_version_attribute,
@@ -494,7 +495,7 @@ const struct attribute_spec c_common_gnu_attributes[] =
/* For internal use (marking of builtins and runtime functions) only.
The name contains space to prevent its usage in source code. */
{ "fn spec", 1, 1, false, true, true, false,
- handle_fnspec_attribute, NULL },
+ common_handle_fnspec_attribute, NULL },
{ "warn_unused", 0, 0, false, false, false, false,
handle_warn_unused_attribute, NULL },
{ "returns_nonnull", 0, 0, false, true, true, false,
@@ -2757,7 +2758,8 @@ static tree
handle_ifunc_attribute (tree *node, tree name, tree args,
int ARG_UNUSED (flags), bool *no_add_attrs)
{
- return handle_alias_ifunc_attribute (false, node, name, args, no_add_attrs);
+ return common_handle_alias_ifunc_attribute (false, node, name, args,
+ no_add_attrs);
}
/* Handle the "copy" attribute NAME by copying the set of attributes
@@ -3198,7 +3200,7 @@ handle_malloc_attribute (tree *node, tree name, tree
args, int flags,
with libgccjit; the deallocator-argument form below is
specific to the C family. */
if (!args)
- return handle_malloc_common (node, name, args, flags, no_add_attrs);
+ return common_handle_malloc_common (node, name, args, flags, no_add_attrs);
tree fndecl = *node;
diff --git a/gcc/d/d-attribs.cc b/gcc/d/d-attribs.cc
index 16ab5cd83680d..19b9ee7c0c89e 100644
--- a/gcc/d/d-attribs.cc
+++ b/gcc/d/d-attribs.cc
@@ -103,27 +103,28 @@ static const attribute_spec
d_langhook_common_attributes[] =
ATTR_SPEC ("noreturn", 0, 0, true, false, false, false,
d_handle_noreturn_attribute, attr_noreturn_exclusions),
ATTR_SPEC ("leaf", 0, 0, true, false, false, false,
- handle_leaf_attribute, NULL),
+ common_handle_leaf_attribute, NULL),
ATTR_SPEC ("const", 0, 0, true, false, false, false,
- handle_const_attribute, attr_const_pure_exclusions),
+ common_handle_const_attribute, attr_const_pure_exclusions),
ATTR_SPEC ("malloc", 0, 0, true, false, false, false,
d_handle_malloc_attribute, NULL),
ATTR_SPEC ("returns_twice", 0, 0, true, false, false, false,
- handle_returns_twice_attribute, attr_returns_twice_exclusions),
+ common_handle_returns_twice_attribute,
+ attr_returns_twice_exclusions),
ATTR_SPEC ("pure", 0, 0, true, false, false, false,
- handle_pure_attribute, attr_const_pure_exclusions),
+ common_handle_pure_attribute, attr_const_pure_exclusions),
ATTR_SPEC ("nonnull", 0, -1, false, true, true, false,
d_handle_nonnull_attribute, NULL),
ATTR_SPEC ("nothrow", 0, 0, true, false, false, false,
- handle_nothrow_attribute, NULL),
+ common_handle_nothrow_attribute, NULL),
ATTR_SPEC ("transaction_pure", 0, 0, false, true, true, false,
d_handle_transaction_pure_attribute, NULL),
ATTR_SPEC ("no vops", 0, 0, true, false, false, false,
- handle_novops_attribute, NULL),
+ common_handle_novops_attribute, NULL),
ATTR_SPEC ("type generic", 0, 0, false, true, true, false,
- handle_type_generic_attribute, NULL),
+ common_handle_type_generic_attribute, NULL),
ATTR_SPEC ("fn spec", 1, 1, false, true, true, false,
- handle_fnspec_attribute, NULL),
+ common_handle_fnspec_attribute, NULL),
ATTR_SPEC ("omp declare simd", 0, -1, true, false, false, false,
d_handle_omp_declare_simd_attribute, NULL),
};
@@ -137,7 +138,7 @@ const scoped_attribute_specs
d_langhook_common_attribute_table =
static const attribute_spec d_langhook_gnu_attributes[] =
{
ATTR_SPEC ("noinline", 0, 0, true, false, false, false,
- handle_noinline_attribute, attr_noinline_exclusions),
+ common_handle_noinline_attribute, attr_noinline_exclusions),
ATTR_SPEC ("always_inline", 0, 0, true, false, false, false,
d_handle_always_inline_attribute, attr_always_inline_exclusions),
ATTR_SPEC ("flatten", 0, 0, true, false, false, false,
@@ -177,7 +178,7 @@ static const attribute_spec d_langhook_gnu_attributes[] =
ATTR_SPEC ("simd", 0, 1, true, false, false, false,
d_handle_simd_attribute, NULL),
ATTR_SPEC ("used", 0, 0, true, false, false, false,
- handle_used_attribute, NULL),
+ common_handle_used_attribute, NULL),
ATTR_SPEC ("visibility", 1, 1, false, false, false, false,
d_handle_visibility_attribute, NULL),
};
diff --git a/gcc/jit/dummy-frontend.cc b/gcc/jit/dummy-frontend.cc
index 0b221306f1351..fa14150fa929b 100644
--- a/gcc/jit/dummy-frontend.cc
+++ b/gcc/jit/dummy-frontend.cc
@@ -73,59 +73,61 @@ static const attribute_spec jit_gnu_attributes[] =
/* { name, min_len, max_len, decl_req, type_req, fn_type_req,
affects_type_identity, handler, exclude } */
{ "alias", 1, 1, true, false, false, false,
- handle_alias_attribute, NULL },
+ common_handle_alias_attribute, NULL },
{ "always_inline", 0, 0, true, false, false, false,
- handle_always_inline_attribute,
+ common_handle_always_inline_attribute,
attr_always_inline_exclusions },
{ "cold", 0, 0, true, false, false, false,
jit_handle_cold_attribute,
attr_cold_hot_exclusions },
/* The same comments as for noreturn attributes apply to const ones. */
{ "const", 0, 0, true, false, false, false,
- handle_const_attribute,
+ common_handle_const_attribute,
attr_const_pure_exclusions },
{ "fn spec", 1, 1, false, true, true, false,
- handle_fnspec_attribute, NULL },
+ common_handle_fnspec_attribute, NULL },
{ "leaf", 0, 0, true, false, false, false,
- handle_leaf_attribute, NULL },
+ common_handle_leaf_attribute, NULL },
{ "malloc", 0, 0, true, false, false, false,
- handle_malloc_common, attr_alloc_exclusions },
+ common_handle_malloc_common,
+ attr_alloc_exclusions },
{ "noreturn", 0, 0, true, false, false, false,
jit_handle_noreturn_attribute,
attr_noreturn_exclusions },
{ "no vops", 0, 0, true, false, false, false,
- handle_novops_attribute, NULL },
+ common_handle_novops_attribute, NULL },
{ "noinline", 0, 0, true, false, false, false,
- handle_noinline_attribute,
+ common_handle_noinline_attribute,
attr_noinline_exclusions },
{ "nonnull", 0, -1, false, true, true, false,
jit_handle_nonnull_attribute, NULL },
{ "nothrow", 0, 0, true, false, false, false,
- handle_nothrow_attribute, NULL },
+ common_handle_nothrow_attribute, NULL },
{ "patchable_function_entry", 1, 2, true, false, false, false,
jit_handle_patchable_function_entry_attribute,
NULL },
{ "pure", 0, 0, true, false, false, false,
- handle_pure_attribute,
+ common_handle_pure_attribute,
attr_const_pure_exclusions },
{ "returns_twice", 0, 0, true, false, false, false,
- handle_returns_twice_attribute,
+ common_handle_returns_twice_attribute,
attr_returns_twice_exclusions },
{ "sentinel", 0, 1, false, true, true, false,
jit_handle_sentinel_attribute, NULL },
{ "target", 1, -1, true, false, false, false,
- handle_target_attribute, attr_target_exclusions },
+ common_handle_target_attribute,
+ attr_target_exclusions },
{ "type generic", 0, 0, false, true, true, false,
- handle_type_generic_attribute, NULL },
+ common_handle_type_generic_attribute, NULL },
{ "transaction_pure", 0, 0, false, true, true, false,
jit_handle_transaction_pure_attribute, NULL },
{ "used", 0, 0, true, false, false, false,
- handle_used_attribute, NULL },
+ common_handle_used_attribute, NULL },
{ "visibility", 1, 1, false, false, false, false,
- handle_visibility_attribute, NULL },
+ common_handle_visibility_attribute, NULL },
{ "weak", 0, 0, true, false, false, false,
- handle_weak_attribute, NULL },
+ common_handle_weak_attribute, NULL },
/* For internal use only. The leading '*' both prevents its usage in
source code and signals that it may be overridden by machine tables. */
{ "*tm regparm", 0, 0, false, true, true, false,
diff --git a/gcc/rust/rust-attribs.cc b/gcc/rust/rust-attribs.cc
index 34afb0e19c030..8b1c11b1a452d 100644
--- a/gcc/rust/rust-attribs.cc
+++ b/gcc/rust/rust-attribs.cc
@@ -126,9 +126,9 @@ static const attribute_spec
grs_langhook_common_attributes[] = {
ATTR_SPEC ("no vops", 0, 0, true, false, false, false,
rust_handle_novops_attribute, NULL),
ATTR_SPEC ("type generic", 0, 0, false, true, true, false,
- handle_type_generic_attribute, NULL),
- ATTR_SPEC ("fn spec", 1, 1, false, true, true, false,
handle_fnspec_attribute,
- NULL),
+ common_handle_type_generic_attribute, NULL),
+ ATTR_SPEC ("fn spec", 1, 1, false, true, true, false,
+ common_handle_fnspec_attribute, NULL),
ATTR_SPEC ("omp declare simd", 0, -1, true, false, false, false,
rust_handle_omp_declare_simd_attribute, NULL),
};
--
2.56.0