GCC Middle and Back End API Reference
attr-handlers.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool validate_attr_args (tree node[2], tree name, tree newargs[2])
bool validate_attr_arg (tree node[2], tree name, tree newarg)
tree handle_alias_ifunc_attribute (bool, tree *, tree, tree, bool *)
tree handle_malloc_common (tree *, tree, tree, int, bool *)
tree handle_alias_attribute (tree *, tree, tree, int, bool *)
tree handle_always_inline_attribute (tree *, tree, tree, int, bool *)
tree handle_const_attribute (tree *, tree, tree, int, bool *)
tree handle_fnspec_attribute (tree *, tree, tree, int, bool *)
tree handle_leaf_attribute (tree *, tree, tree, int, bool *)
tree handle_noinline_attribute (tree *, tree, tree, int, bool *)
tree handle_nothrow_attribute (tree *, tree, tree, int, bool *)
tree handle_novops_attribute (tree *, tree, tree, int, bool *)
tree handle_pure_attribute (tree *, tree, tree, int, bool *)
tree handle_retain_attribute (tree *, tree, tree, int, bool *)
tree handle_returns_twice_attribute (tree *, tree, tree, int, bool *)
tree handle_section_attribute (tree *, tree, tree, int, bool *)
tree handle_target_attribute (tree *, tree, tree, int, bool *)
tree handle_type_generic_attribute (tree *, tree, tree, int, bool *)
tree handle_used_attribute (tree *, tree, tree, int, bool *)
tree handle_visibility_attribute (tree *, tree, tree, int, bool *)
tree handle_weak_attribute (tree *, tree, tree, int, bool *)
tree ignore_attribute (tree *, tree, tree, int, bool *)

Variables

const struct attribute_spec::exclusions attr_noreturn_exclusions []
const struct attribute_spec::exclusions attr_returns_twice_exclusions []
const struct attribute_spec::exclusions attr_alloc_exclusions []
const struct attribute_spec::exclusions attr_const_pure_exclusions []
const struct attribute_spec::exclusions attr_always_inline_exclusions []
const struct attribute_spec::exclusions attr_cold_hot_exclusions []
const struct attribute_spec::exclusions attr_noinline_exclusions []
const struct attribute_spec::exclusions attr_target_exclusions []
const struct attribute_spec::exclusions attr_section_exclusions []

Function Documentation

◆ handle_alias_attribute()

tree handle_alias_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_alias_ifunc_attribute()

tree handle_alias_ifunc_attribute ( bool is_alias,
tree * node,
tree name,
tree args,
bool * no_add_attrs )
extern
Attribute handlers.   
Handle an "alias" or "ifunc" attribute; arguments as in
struct attribute_spec.handler, except that IS_ALIAS tells us
whether this is an alias as opposed to ifunc attribute.   

References current_function_decl, DECL_ATTRIBUTES, DECL_EXTERNAL, decl_function_context(), decl_in_symtab_p(), DECL_INITIAL, error(), error_mark_node, symtab_node::get(), get_identifier(), handle_alias_ifunc_attribute(), lookup_attribute(), NULL, NULL_TREE, TREE_CODE, tree_cons(), TREE_PUBLIC, TREE_STATIC, TREE_STRING_POINTER, TREE_USED, TREE_VALUE, VAR_P, and warning().

Referenced by handle_alias_attribute(), and handle_alias_ifunc_attribute().

◆ handle_always_inline_attribute()

tree handle_always_inline_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_const_attribute()

tree handle_const_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_fnspec_attribute()

tree handle_fnspec_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_leaf_attribute()

tree handle_leaf_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_malloc_common()

tree handle_malloc_common ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_noinline_attribute()

tree handle_noinline_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_nothrow_attribute()

tree handle_nothrow_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_novops_attribute()

tree handle_novops_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_pure_attribute()

tree handle_pure_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_retain_attribute()

tree handle_retain_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_returns_twice_attribute()

tree handle_returns_twice_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_section_attribute()

tree handle_section_attribute ( tree * node,
tree name,
tree args,
int flags,
bool * no_add_attrs )
extern

◆ handle_target_attribute()

tree handle_target_attribute ( tree * node,
tree name,
tree args,
int flags,
bool * no_add_attrs )
extern

◆ handle_type_generic_attribute()

tree handle_type_generic_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_used_attribute()

tree handle_used_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_visibility_attribute()

tree handle_visibility_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ handle_weak_attribute()

tree handle_weak_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

◆ ignore_attribute()

tree ignore_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern

References ignore_attribute().

◆ validate_attr_arg()

bool validate_attr_arg ( tree node[2],
tree name,
tree newarg )
extern
Convenience wrapper for validate_attr_args to validate a single
attribute argument.  Used by handlers for attributes that take
just a single argument.   

References NULL_TREE, validate_attr_arg(), and validate_attr_args().

Referenced by handle_section_attribute(), and validate_attr_arg().

◆ validate_attr_args()

bool validate_attr_args ( tree node[2],
tree name,
tree newargs[2] )
extern
Shared helpers used by the handlers.   
Given a pair of NODEs for arbitrary DECLs or TYPEs, validate one or
two integral or string attribute arguments NEWARGS to be applied to
NODE[0] for the absence of conflicts with the same attribute arguments
already applied to NODE[1]. Issue a warning for conflicts and return
false.  Otherwise, when no conflicts are found, return true.   

References decl_or_type_attrs(), DECL_P, DECL_SOURCE_LOCATION, gcc_unreachable, IDENTIFIER_POINTER, inform(), input_location, lookup_attribute(), print_generic_expr_to_str(), TREE_CHAIN, TREE_CODE, tree_int_cst_equal(), TREE_STRING_POINTER, TREE_VALUE, validate_attr_args(), and warning_at().

Referenced by validate_attr_arg(), and validate_attr_args().

Variable Documentation

◆ attr_alloc_exclusions

const struct attribute_spec::exclusions attr_alloc_exclusions[]
extern
Exclusions that apply to attribute alloc_align, alloc_size, and malloc.   

◆ attr_always_inline_exclusions

const struct attribute_spec::exclusions attr_always_inline_exclusions[]
extern

◆ attr_cold_hot_exclusions

const struct attribute_spec::exclusions attr_cold_hot_exclusions[]
extern

◆ attr_const_pure_exclusions

const struct attribute_spec::exclusions attr_const_pure_exclusions[]
extern

◆ attr_noinline_exclusions

const struct attribute_spec::exclusions attr_noinline_exclusions[]
extern

◆ attr_noreturn_exclusions

const struct attribute_spec::exclusions attr_noreturn_exclusions[]
extern
Language-independent attribute handlers shared across front ends.
   Copyright (C) 2026 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Attribute exclusion tables used by `c-family` and `libgccjit`.   
Define attributes that are mutually exclusive with one another.   

◆ attr_returns_twice_exclusions

const struct attribute_spec::exclusions attr_returns_twice_exclusions[]
extern

◆ attr_section_exclusions

const struct attribute_spec::exclusions attr_section_exclusions[]
extern
Exclusions that apply to attributes that put declarations in specific
sections.   

◆ attr_target_exclusions

const struct attribute_spec::exclusions attr_target_exclusions[]
extern