GCC Middle and Back End API Reference
attr-handlers.h
Go to the documentation of this file.
1/* Language-independent attribute handlers shared across front ends.
2 Copyright (C) 2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_ATTR_HANDLERS_H
21#define GCC_ATTR_HANDLERS_H
22
23/* Attribute exclusion tables used by `c-family` and `libgccjit`. */
24extern const struct attribute_spec::exclusions attr_noreturn_exclusions[];
25extern const struct attribute_spec::exclusions attr_returns_twice_exclusions[];
26extern const struct attribute_spec::exclusions attr_alloc_exclusions[];
27extern const struct attribute_spec::exclusions attr_const_pure_exclusions[];
28extern const struct attribute_spec::exclusions attr_always_inline_exclusions[];
29extern const struct attribute_spec::exclusions attr_cold_hot_exclusions[];
30extern const struct attribute_spec::exclusions attr_noinline_exclusions[];
31extern const struct attribute_spec::exclusions attr_target_exclusions[];
32extern const struct attribute_spec::exclusions attr_section_exclusions[];
33
34/* Shared helpers used by the handlers. */
35extern bool validate_attr_args (tree node[2], tree name, tree newargs[2]);
36extern bool validate_attr_arg (tree node[2], tree name, tree newarg);
37
38/* Attribute handlers. */
39extern tree handle_alias_ifunc_attribute (bool, tree *, tree, tree, bool *);
40extern tree handle_malloc_common (tree *, tree, tree, int, bool *);
41extern tree handle_alias_attribute (tree *, tree, tree, int, bool *);
43extern tree handle_const_attribute (tree *, tree, tree, int, bool *);
44extern tree handle_fnspec_attribute (tree *, tree, tree, int, bool *);
45extern tree handle_leaf_attribute (tree *, tree, tree, int, bool *);
46extern tree handle_noinline_attribute (tree *, tree, tree, int, bool *);
47extern tree handle_nothrow_attribute (tree *, tree, tree, int, bool *);
48extern tree handle_novops_attribute (tree *, tree, tree, int, bool *);
49extern tree handle_pure_attribute (tree *, tree, tree, int, bool *);
50extern tree handle_retain_attribute (tree *, tree, tree, int, bool *);
52extern tree handle_section_attribute (tree *, tree, tree, int, bool *);
53extern tree handle_target_attribute (tree *, tree, tree, int, bool *);
55extern tree handle_used_attribute (tree *, tree, tree, int, bool *);
56extern tree handle_visibility_attribute (tree *, tree, tree, int, bool *);
57extern tree handle_weak_attribute (tree *, tree, tree, int, bool *);
58extern tree ignore_attribute (tree *, tree, tree, int, bool *);
59
60#endif // GCC_ATTR_HANDLERS_H
bool validate_attr_args(tree node[2], tree name, tree newargs[2])
Definition attr-handlers.cc:147
tree handle_alias_attribute(tree *node, tree name, tree args, int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:748
const struct attribute_spec::exclusions attr_section_exclusions[]
Definition attr-handlers.cc:109
tree handle_pure_attribute(tree *node, tree name, tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:413
tree handle_always_inline_attribute(tree *node, tree name, tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:617
const struct attribute_spec::exclusions attr_always_inline_exclusions[]
Definition attr-handlers.cc:79
tree handle_nothrow_attribute(tree *node, tree name, tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:452
const struct attribute_spec::exclusions attr_target_exclusions[]
Definition attr-handlers.cc:100
tree handle_leaf_attribute(tree *node, tree name, tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:353
bool validate_attr_arg(tree node[2], tree name, tree newarg)
Definition attr-handlers.cc:242
tree handle_target_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs)
Definition attr-handlers.cc:688
tree handle_weak_attribute(tree *node, tree name, tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *ARG_UNUSED(no_add_attrs))
Definition attr-handlers.cc:660
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))
Definition attr-handlers.cc:470
tree handle_used_attribute(tree *pnode, tree name, tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:721
tree handle_retain_attribute(tree *pnode, tree name, tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:837
tree handle_const_attribute(tree *node, tree name, tree ARG_UNUSED(args), int flags, bool *no_add_attrs)
Definition attr-handlers.cc:376
tree handle_fnspec_attribute(tree *node, tree ARG_UNUSED(name), tree args, int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:504
const struct attribute_spec::exclusions attr_returns_twice_exclusions[]
Definition attr-handlers.cc:53
const struct attribute_spec::exclusions attr_noreturn_exclusions[]
Definition attr-handlers.cc:41
const struct attribute_spec::exclusions attr_alloc_exclusions[]
Definition attr-handlers.cc:60
tree handle_alias_ifunc_attribute(bool is_alias, tree *node, tree name, tree args, bool *no_add_attrs)
Definition attr-handlers.cc:253
const struct attribute_spec::exclusions attr_const_pure_exclusions[]
Definition attr-handlers.cc:68
tree handle_noinline_attribute(tree *node, tree name, tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:641
tree ignore_attribute(tree *ARG_UNUSED(node), tree ARG_UNUSED(name), tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:341
tree handle_malloc_common(tree *node, tree name, tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:859
tree handle_visibility_attribute(tree *node, tree name, tree args, int ARG_UNUSED(flags), bool *ARG_UNUSED(no_add_attrs))
Definition attr-handlers.cc:518
const struct attribute_spec::exclusions attr_cold_hot_exclusions[]
Definition attr-handlers.cc:86
const struct attribute_spec::exclusions attr_noinline_exclusions[]
Definition attr-handlers.cc:93
tree handle_section_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs)
Definition attr-handlers.cc:758
tree handle_novops_attribute(tree *node, tree ARG_UNUSED(name), tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *ARG_UNUSED(no_add_attrs))
Definition attr-handlers.cc:439
tree handle_returns_twice_attribute(tree *node, tree name, tree ARG_UNUSED(args), int ARG_UNUSED(flags), bool *no_add_attrs)
Definition attr-handlers.cc:486
union tree_node * tree
Definition coretypes.h:97
Definition custom-sarif-properties/state-graphs.h:33