GCC Middle and Back End API Reference
attribs.h File Reference

Go to the source code of this file.

Data Structures

struct  scoped_attribute_specs
 
struct  attr_access
 
struct  rdwr_access_hash
 

Typedefs

typedef hash_map< rdwr_access_hash, attr_accessrdwr_map
 

Functions

const struct attribute_spec * lookup_attribute_spec (const_tree)
 
void free_attr_data ()
 
void init_attributes (void)
 
tree decl_attributes (tree *, tree, int, tree=NULL_TREE)
 
bool cxx11_attribute_p (const_tree)
 
tree get_attribute_name (const_tree)
 
tree get_attribute_namespace (const_tree)
 
void apply_tm_attr (tree, tree)
 
tree make_attribute (const char *, const char *, tree)
 
bool attribute_ignored_p (tree)
 
bool attribute_ignored_p (const attribute_spec *const)
 
bool any_nonignored_attribute_p (tree)
 
struct scoped_attributesregister_scoped_attributes (const scoped_attribute_specs &, bool=false)
 
char * sorted_attr_string (tree)
 
bool common_function_versions (tree, tree)
 
tree make_dispatcher_decl (const tree)
 
bool is_function_default_version (const tree)
 
void handle_ignored_attributes_option (vec< char * > *)
 
tree build_type_attribute_variant (tree, tree)
 
tree build_decl_attribute_variant (tree, tree)
 
tree build_type_attribute_qual_variant (tree, tree, int)
 
bool simple_cst_list_equal (const_tree, const_tree)
 
bool attribute_value_equal (const_tree, const_tree)
 
int comp_type_attributes (const_tree, const_tree)
 
tree affects_type_identity_attributes (tree, bool=true)
 
tree restrict_type_identity_attributes_to (tree, tree)
 
tree merge_decl_attributes (tree, tree)
 
tree merge_type_attributes (tree, tree)
 
tree remove_attribute (const char *, tree)
 
tree remove_attribute (const char *, const char *, tree)
 
tree merge_attributes (tree, tree)
 
void duplicate_one_attribute (tree *, tree, const char *)
 
void copy_attributes_to_builtin (tree)
 
tree merge_dllimport_decl_attributes (tree, tree)
 
tree handle_dll_attribute (tree *, tree, tree, int, bool *)
 
int attribute_list_equal (const_tree, const_tree)
 
int attribute_list_contained (const_tree, const_tree)
 
tree private_lookup_attribute (const char *attr_name, size_t attr_len, tree list)
 
tree private_lookup_attribute (const char *attr_ns, const char *attr_name, size_t attr_ns_len, size_t attr_len, tree list)
 
unsigned decls_mismatched_attributes (tree, tree, tree, const char *const[], auto_vec< const char * > &)
 
void maybe_diag_alias_attributes (tree, tree)
 
template<typename T >
bool canonicalize_attr_name (const char *&s, T &l)
 
tree canonicalize_attr_name (tree attr_name)
 
bool cmp_attribs (const char *attr1, size_t attr1_len, const char *attr2, size_t attr2_len)
 
bool cmp_attribs (const char *attr1, const char *attr2)
 
bool is_attribute_p (const char *attr_name, const_tree ident)
 
bool is_attribute_namespace_p (const char *attr_ns, const_tree attr)
 
tree lookup_attribute (const char *attr_name, tree list)
 
tree lookup_attribute (const char *attr_ns, const char *attr_name, tree list)
 
tree lookup_attribute_by_prefix (const char *attr_name, tree list)
 
void init_attr_rdwr_indices (rdwr_map *, tree)
 
attr_accessget_parm_access (rdwr_map &, tree, tree=current_function_decl)
 

Typedef Documentation

◆ rdwr_map

Function Documentation

◆ affects_type_identity_attributes()

tree affects_type_identity_attributes ( tree attrs,
bool value )
extern
If VALUE is true, return the subset of ATTRS that affect type identity,
otherwise return the subset of ATTRS that don't affect type identity.   

References bool, and remove_attributes_matching().

◆ any_nonignored_attribute_p()

bool any_nonignored_attribute_p ( tree attrs)
extern
Return true if the ATTRS chain contains at least one attribute which
is not ignored.   

References attribute_ignored_p(), and TREE_CHAIN.

◆ apply_tm_attr()

void apply_tm_attr ( tree fndecl,
tree attr )
extern
Subroutine of set_method_tm_attributes.  Apply TM attribute ATTR
to the method FNDECL.   

References decl_attributes(), NULL, tree_cons(), and TREE_TYPE.

Referenced by set_call_expr_flags().

◆ attribute_ignored_p() [1/2]

bool attribute_ignored_p ( const attribute_spec *const as)
extern
Like above, but takes an attribute_spec AS, which must be nonnull.   

◆ attribute_ignored_p() [2/2]

bool attribute_ignored_p ( tree attr)
extern
Return true if the attribute ATTR should not be warned about.   

References attr_namespace_ignored_p(), cxx11_attribute_p(), get_attribute_namespace(), lookup_attribute_spec(), NULL, and TREE_PURPOSE.

Referenced by any_nonignored_attribute_p(), and decl_attributes().

◆ attribute_list_contained()

int attribute_list_contained ( const_tree l1,
const_tree l2 )
extern
Given two lists of attributes, return true if list L2 is
completely contained within L1.   
??? This would be faster if attribute names were stored in a canonicalized
form.  Otherwise, if L1 uses `foo' and L2 uses `__foo__', the long method
must be used to show these elements are equivalent (which they are).   
??? It's not clear that attributes with arguments will always be handled
correctly.   

References attribute_value_equal(), CONST_CAST_TREE, get_attribute_name(), lookup_ident_attribute(), NULL_TREE, TREE_CHAIN, and TREE_VALUE.

Referenced by attribute_list_equal(), and merge_attributes().

◆ attribute_list_equal()

int attribute_list_equal ( const_tree l1,
const_tree l2 )
extern

◆ attribute_value_equal()

bool attribute_value_equal ( const_tree attr1,
const_tree attr2 )
extern
Compare two attributes for their value identity.  Return true if the
attribute values are known to be equal; otherwise return false.   

References cmp_attrib_identifiers(), get_attribute_name(), is_attribute_p(), NULL_TREE, omp_declare_simd_clauses_equal(), simple_cst_equal(), simple_cst_list_equal(), TREE_CHAIN, TREE_CODE, and TREE_VALUE.

Referenced by attribute_list_contained(), comp_type_attributes(), duplicate_one_attribute(), merge_attributes(), and redirect_to_specific_clone().

◆ build_decl_attribute_variant()

tree build_decl_attribute_variant ( tree ddecl,
tree attribute )
extern
Return a declaration like DDECL except that its DECL_ATTRIBUTES
is ATTRIBUTE.   

References DECL_ATTRIBUTES.

◆ build_type_attribute_qual_variant()

tree build_type_attribute_qual_variant ( tree otype,
tree attribute,
int quals )
extern

◆ build_type_attribute_variant()

tree build_type_attribute_variant ( tree ttype,
tree attribute )
extern
Return a type like TTYPE except that its TYPE_ATTRIBUTES
is ATTRIBUTE.

Such modified types already made are recorded so that duplicates
are not made.   
Return a type like TTYPE except that its TYPE_ATTRIBUTE
is ATTRIBUTE.

Record such modified types already made so we don't make duplicates.   

References build_type_attribute_qual_variant(), and TYPE_QUALS.

Referenced by decl_attributes().

◆ canonicalize_attr_name() [1/2]

template<typename T >
bool canonicalize_attr_name ( const char *& s,
T & l )
inline
For a given string S of length L, strip leading and trailing '_' characters
so that we have a canonical form of attribute names.  NB: This function may
change S and L.   

Referenced by canonicalize_attr_name(), handle_ignored_attributes_option(), lookup_attribute(), lookup_attribute(), and register_scoped_attribute().

◆ canonicalize_attr_name() [2/2]

tree canonicalize_attr_name ( tree attr_name)
inline
For a given IDENTIFIER_NODE, strip leading and trailing '_' characters
so that we have a canonical form of attribute names.   

References canonicalize_attr_name(), get_identifier_with_length(), IDENTIFIER_LENGTH, and IDENTIFIER_POINTER.

◆ cmp_attribs() [1/2]

bool cmp_attribs ( const char * attr1,
const char * attr2 )
inline
Compare attribute identifiers ATTR1 and ATTR2.   

References cmp_attribs().

◆ cmp_attribs() [2/2]

bool cmp_attribs ( const char * attr1,
size_t attr1_len,
const char * attr2,
size_t attr2_len )
inline
Compare attribute identifiers ATTR1 and ATTR2 with length ATTR1_LEN and
ATTR2_LEN.   

Referenced by cmp_attrib_identifiers(), cmp_attribs(), is_attribute_p(), private_lookup_attribute(), and private_lookup_attribute().

◆ common_function_versions()

bool common_function_versions ( tree fn1,
tree fn2 )
extern
This function returns true if FN1 and FN2 are versions of the same function,
that is, the target strings of the function decls are different.  This assumes
that FN1 and FN2 have the same signature.   

References copy_node(), DECL_ATTRIBUTES, DECL_FUNCTION_VERSIONED, DECL_SOURCE_LOCATION, error_at(), get_identifier(), inform(), lookup_attribute(), NULL_TREE, sorted_attr_string(), TREE_CODE, tree_cons(), and TREE_VALUE.

◆ comp_type_attributes()

◆ copy_attributes_to_builtin()

void copy_attributes_to_builtin ( tree decl)
extern
Duplicate all attributes from user DECL to the corresponding
builtin that should be propagated.   

References b, builtin_decl_explicit(), DECL_ATTRIBUTES, DECL_FUNCTION_CODE(), and duplicate_one_attribute().

◆ cxx11_attribute_p()

bool cxx11_attribute_p ( const_tree attr)
extern
Return TRUE iff ATTR has been parsed by the front-end as a C++-11
attribute.

When G++ parses a C++11 attribute, it is represented as
a TREE_LIST which TREE_PURPOSE is itself a TREE_LIST.  TREE_PURPOSE
(TREE_PURPOSE (ATTR)) is the namespace of the attribute, and the
TREE_VALUE (TREE_PURPOSE (ATTR)) is its non-qualified name.  Please
use get_attribute_namespace and get_attribute_name to retrieve the
namespace and name of the attribute, as these accessors work with
GNU attributes as well.   

References NULL_TREE, TREE_CODE, and TREE_PURPOSE.

Referenced by attribute_ignored_p(), decl_attributes(), get_attribute_name(), and get_attribute_namespace().

◆ decl_attributes()

tree decl_attributes ( tree * node,
tree attributes,
int flags,
tree last_decl )
extern
Process the attributes listed in ATTRIBUTES and install them in *NODE,
which is either a DECL (including a TYPE_DECL) or a TYPE.  If a DECL,
it should be modified in place; if a TYPE, a copy should be created
unless ATTR_FLAG_TYPE_IN_PLACE is set in FLAGS.  FLAGS gives further
information, in the form of a bitwise OR of flags in enum attribute_flags
from tree.h.  Depending on these flags, some attributes may be
returned to be applied at a later stage (for example, to apply
a decl attribute to the declaration rather than to its type).   

References a, ATTR_FLAG_ARRAY_NEXT, ATTR_FLAG_BUILT_IN, ATTR_FLAG_CXX11, ATTR_FLAG_DECL_NEXT, ATTR_FLAG_FUNCTION_NEXT, ATTR_FLAG_TYPE_IN_PLACE, attr_namespace_ignored_p(), attribute_ignored_p(), attributes_initialized, build_pointer_type(), build_qualified_type(), build_target_option_node(), build_tree_list(), build_type_attribute_variant(), build_variant_type_copy(), BUILT_IN_NORMAL, chainon(), COMPLETE_TYPE_P, copy_list(), current_optimize_pragma, current_target_pragma, cxx11_attribute_p(), DECL_ATTRIBUTES, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE(), DECL_FUNCTION_SPECIFIC_OPTIMIZATION, DECL_FUNCTION_SPECIFIC_TARGET, DECL_ORIGINAL_TYPE, DECL_P, diag_attr_exclusions(), error(), error_mark_node, error_operand_p(), find_same_attribute(), FUNC_OR_METHOD_TYPE_P, gcc_assert, get_attribute_name(), get_attribute_namespace(), get_identifier(), global_options, global_options_set, inform(), init_attributes(), input_location, is_attribute_p(), list_length(), lookup_attribute(), lookup_attribute_spec(), lookup_scoped_attribute_spec(), NULL, NULL_TREE, optimization_current_node, optimization_default_node, POINTER_TYPE_P, r, relayout_decl(), simple_cst_equal(), target_option_current_node, target_option_default_node, targetm, TREE_CHAIN, TREE_CODE, tree_cons(), TREE_TYPE, TREE_VALUE, TYPE_ATTRIBUTES, TYPE_MAIN_VARIANT, TYPE_NAME, TYPE_NEXT_VARIANT, TYPE_P, TYPE_QUALS, VAR_P, and warning().

Referenced by apply_tm_attr(), and build_builtin_function().

◆ decls_mismatched_attributes()

unsigned decls_mismatched_attributes ( tree tmpl,
tree decl,
tree attrlist,
const char *const blacklist[],
auto_vec< const char * > & outattrs )
extern
Return the number of mismatched function or type attributes between
the "template" function declaration TMPL and DECL.  The word "template"
doesn't necessarily refer to a C++ template but rather a declaration
whose attributes should be matched by those on DECL.  For a non-zero
return value append the names of the mismatcheed attributes to OUTATTRS.
ATTRLIST is a list of additional attributes that SPEC should be
taken to ultimately be declared with.   

References DECL_ATTRIBUTES, decls, has_attribute(), i, lookup_attribute(), TREE_CODE, TREE_DEPRECATED, TREE_PUBLIC, TREE_TYPE, and TYPE_ATTRIBUTES.

Referenced by maybe_diag_alias_attributes().

◆ duplicate_one_attribute()

void duplicate_one_attribute ( tree * attrs,
tree attr,
const char * name )
extern
Duplicate all attributes with name NAME in ATTR list to *ATTRS if
they are missing there.   

References a, attribute_value_equal(), attrs, copy_node(), lookup_attribute(), and TREE_CHAIN.

Referenced by copy_attributes_to_builtin().

◆ free_attr_data()

void free_attr_data ( )
extern
Free data we might have allocated when adding extra attributes.   

References ignored_attributes_table.

Referenced by compile_file().

◆ get_attribute_name()

◆ get_attribute_namespace()

tree get_attribute_namespace ( const_tree attr)
extern
Return the namespace of the attribute ATTR.  This accessor works on
GNU and C++11 (scoped) attributes.  On GNU attributes,
it returns an identifier tree for the string "gnu".

Please read the comments of cxx11_attribute_p to understand the
format of attributes.   

References cxx11_attribute_p(), get_gnu_namespace(), and TREE_PURPOSE.

Referenced by attribute_ignored_p(), decl_attributes(), find_same_attribute(), is_attribute_namespace_p(), and private_lookup_attribute().

◆ get_parm_access()

attr_access * get_parm_access ( rdwr_map & rdwr_idx,
tree parm,
tree fndecl )
extern
Return the access specification for a function parameter PARM
or null if the current function has no such specification.   

References DECL_ARGUMENTS, hash_map< KeyId, Value, Traits >::get(), init_attr_rdwr_indices(), hash_map< KeyId, Value, Traits >::is_empty(), NULL, TREE_CHAIN, TREE_TYPE, and TYPE_ATTRIBUTES.

Referenced by gimple_parm_array_size(), and parm_object_size().

◆ handle_dll_attribute()

tree handle_dll_attribute ( tree * ,
tree ,
tree ,
int ,
bool *  )
extern
Handle a "dllimport" or "dllexport" attribute.   

◆ handle_ignored_attributes_option()

void handle_ignored_attributes_option ( vec< char * > * v)
extern
Parse arguments V of -Wno-attributes=.
Currently we accept:
  vendor::attr
  vendor::
This functions also registers the parsed attributes so that we don't
warn that we don't recognize them.   

References attrs, canonicalize_attr_name(), error(), get_identifier_with_length(), i, IDENTIFIER_POINTER, ignored_attributes_table, inform(), input_location, lookup_scoped_attribute_spec(), register_scoped_attributes(), and table.

Referenced by init_attributes().

◆ init_attr_rdwr_indices()

void init_attr_rdwr_indices ( rdwr_map * rwm,
tree attrs )
extern

◆ init_attributes()

void init_attributes ( void )
extern

◆ is_attribute_namespace_p()

bool is_attribute_namespace_p ( const char * attr_ns,
const_tree attr )
inline
Given an attribute ATTR and a string ATTR_NS, return true
if the attribute namespace is valid for the string.  ATTR_NS "" stands
for standard attribute (NULL get_attribute_namespace) or "gnu"
namespace.   

References get_attribute_namespace(), is_attribute_p(), NULL, and NULL_TREE.

Referenced by remove_attribute().

◆ is_attribute_p()

bool is_attribute_p ( const char * attr_name,
const_tree ident )
inline

◆ is_function_default_version()

bool is_function_default_version ( const tree decl)
extern
Returns true if DECL is multi-versioned using the target attribute, and this
is the default version.  This function can only be used for targets that do
not support the "target_version" attribute.   

References DECL_ATTRIBUTES, DECL_FUNCTION_VERSIONED, gcc_assert, lookup_attribute(), TREE_CODE, TREE_STRING_POINTER, and TREE_VALUE.

◆ lookup_attribute() [1/2]

tree lookup_attribute ( const char * attr_name,
tree list )
inline
Given an attribute name ATTR_NAME and a list of attributes LIST,
return a pointer to the attribute's list element if the attribute
is part of the list, or NULL_TREE if not found.  If the attribute
appears more than once, this only returns the first occurrence; the
TREE_CHAIN of the return value should be passed back in if further
occurrences are wanted.  ATTR_NAME must be in the form 'text' (not
'__text__').   

References canonicalize_attr_name(), gcc_checking_assert, NULL_TREE, and private_lookup_attribute().

Referenced by varpool_node::add(), add_clobbers_to_eh_landing_pad(), add_decls_addresses_to_decl_constructor(), add_detected_attribute_1(), alloc_object_size(), analyze_functions(), asan_poison_variables(), asan_protect_global(), assemble_alias(), assemble_external(), assemble_start_function(), auto_simd_check_stmt(), avoid_folding_inline_builtin(), block_nonartificial_location(), btf_add_func_records(), build_pointer_type_for_mode(), build_reference_type_for_mode(), can_early_inline_edge_p(), can_inline_edge_by_limits_p(), can_strub_internally_p(), can_strub_p(), cgraph_externally_visible_p(), strlen_pass::check_and_optimize_call(), check_scan_store(), common_function_versions(), comp_type_attributes(), symbol_table::compile(), computable_teams_clause(), compute_fn_summary(), compute_function_frequency(), copy_decl_for_dup_finish(), cgraph_node::create(), cgraph_node::create_alias(), varpool_node::create_alias(), create_assumption_fn(), create_nesting_tree(), create_omp_child_function(), create_parallel_loop(), cxx17_empty_base_field_p(), decl_attributes(), decl_fnspec(), declare_weak(), decls_mismatched_attributes(), default_binds_local_p_3(), determine_versionability(), device_resident_p(), diag_attr_exclusions(), do_assemble_alias(), do_estimate_edge_time(), do_warn_unused_result(), duplicate_one_attribute(), early_inliner(), symtab_node::equal_address_to(), error_unavailable_use(), evaluate_stmt(), execute_oacc_loop_designation(), execute_ranger_vrp(), execute_split_functions(), expand_call_inline(), expand_expr_real_1(), expand_oacc_for(), expand_omp_target(), expand_one_var(), expand_simd_clones(), expand_target_clones(), expand_used_vars(), varpool_node::externally_visible_p(), varpool_node::finalize_decl(), find_simtpriv_var_op(), flags_from_decl_or_type(), flatten_remove_node_hook(), fndecl_alloc_p(), fndecl_dealloc_argno(), attr_access::free_lang_data(), function_and_variable_visibility(), gate_oacc_kernels(), get_alias_symbol(), get_attr_nonstring_decl(), cgraph_node::get_availability(), get_block_for_decl(), varpool_node::get_create(), get_nonnull_args(), get_section(), get_strub_attr_from_decl(), get_strub_attr_from_type(), get_variable_section(), gimple_build_call_from_tree(), gimple_call_alloc_size(), gimple_call_fnspec(), gimple_call_nonnull_result_p(), gimple_infer_range::gimple_infer_range(), gimplify_adjust_omp_clauses(), gimplify_adjust_omp_clauses_1(), gimplify_bind_expr(), gimplify_body(), gimplify_call_expr(), gimplify_case_label_expr(), gimplify_label_expr(), handle_alias_pairs(), handle_warn_if_not_align(), has_attribute(), infer_nonnull_range_by_attribute(), init_attr_rdwr_indices(), inline_always_inline_functions(), inline_forbidden_p_stmt(), input_node(), ipa_inline(), ipa_pta_execute(), is_asan_mark_p(), is_function_default_version(), is_in_offload_region(), is_oacc_declared(), is_odr_indicator(), is_tm_callable(), is_tm_irrevocable(), is_tm_may_cancel_outer(), is_tm_safe(), is_var_need_auto_init(), likely_target_p(), lower_lastprivate_clauses(), lower_omp_scan(), lto_output_node(), make_split_prologue_seq(), matching_alloc_calls_p(), maybe_diag_alias_attributes(), ipa_icf::sem_function::merge(), ipa_icf::sem_item_optimizer::merge_classes(), non_local_p(), symtab_node::noninterposable_alias(), nonnull_arg_p(), note_simd_array_uses_cb(), oacc_get_fn_attrib(), oacc_validate_dims(), oacc_verify_routine_clauses(), offloading_function_p(), ok_for_auto_simd_clone(), omp_construct_selector_matches(), omp_context_selector_matches(), omp_declare_target_fn_p(), omp_declare_target_var_p(), omp_discover_declare_target_tgt_fn_r(), omp_discover_declare_target_var_r(), omp_discover_implicit_declare_target(), omp_finish_file(), omp_lto_input_declare_variant_alt(), omp_lto_output_declare_variant_alt(), omp_mark_declare_variant(), omp_maybe_offloaded(), omp_notice_variable(), omp_resolve_declare_variant(), possible_inline_candidate_p(), process_common_attributes(), process_function_and_variable_attributes(), process_symver_attribute(), redirect_to_specific_clone(), refered_from_nonlocal_fn(), remove_named_attribute_unsharing(), resolve_unique_section(), rest_of_decl_compilation(), rest_of_handle_final(), restrict_type_identity_attributes_to(), sanitize_attrs_match_for_inline_p(), sanitize_coverage_p(), sanitize_flags_p(), scan_omp_1_op(), scan_sharing_clauses(), stack_protect_decl_phase(), strub_always_inline_p(), surely_varying_stmt_p(), switch_to_section(), tree_bb_level_predictions(), tree_expr_nonzero_warnv_p(), tree_inlinable_function_p(), tree_profiling(), tree_versionable_function_p(), unlikely_executed_stmt_p(), validate_arglist(), vect_recog_pow_pattern(), vectorizable_scan_store(), symtab_node::verify_base(), verify_node_partition(), visit_bb(), and warn_deprecated_use().

◆ lookup_attribute() [2/2]

tree lookup_attribute ( const char * attr_ns,
const char * attr_name,
tree list )
inline
Similar to lookup_attribute, but also match the attribute namespace.
ATTR_NS "" stands for either standard attribute or "gnu" namespace.   

References canonicalize_attr_name(), gcc_checking_assert, NULL_TREE, and private_lookup_attribute().

◆ lookup_attribute_by_prefix()

tree lookup_attribute_by_prefix ( const char * attr_name,
tree list )
inline
Given an attribute name ATTR_NAME and a list of attributes LIST,
return a pointer to the attribute's list first element if the attribute
starts with ATTR_NAME.  ATTR_NAME must be in the form 'text' (not
'__text__').   

References gcc_checking_assert, get_attribute_name(), IDENTIFIER_LENGTH, IDENTIFIER_POINTER, NULL_TREE, and TREE_CHAIN.

Referenced by ipa_icf::sem_function::parse().

◆ lookup_attribute_spec()

const struct attribute_spec * lookup_attribute_spec ( const_tree name)
extern
Return the spec for the attribute named NAME.  If NAME is a TREE_LIST,
it also specifies the attribute namespace.   

References get_gnu_namespace(), lookup_scoped_attribute_spec(), TREE_CODE, TREE_PURPOSE, and TREE_VALUE.

Referenced by attribute_ignored_p(), comp_type_attributes(), decl_attributes(), and remove_attributes_matching().

◆ make_attribute()

tree make_attribute ( const char * name,
const char * arg_name,
tree chain )
extern
Makes a function attribute of the form NAME(ARG_NAME) and chains
it to CHAIN.   

References build_string(), get_identifier(), NULL_TREE, and tree_cons().

Referenced by expand_target_clones().

◆ make_dispatcher_decl()

tree make_dispatcher_decl ( const tree decl)
extern
Make a dispatcher declaration for the multi-versioned function DECL.
Calls to DECL function will be replaced with calls to the dispatcher
by the front-end.  Return the decl created.   

References build_fn_decl(), build_function_type(), DECL_ARTIFICIAL, DECL_ASSEMBLER_NAME, DECL_CONTEXT, DECL_EXTERNAL, DECL_INITIAL, error_mark_node, IDENTIFIER_POINTER, NULL_TREE, TREE_PUBLIC, TREE_TYPE, TREE_USED, and TYPE_ARG_TYPES.

◆ maybe_diag_alias_attributes()

void maybe_diag_alias_attributes ( tree alias,
tree target )
extern
Issue a warning for the declaration ALIAS for TARGET where ALIAS
specifies either attributes that are incompatible with those of
TARGET, or attributes that are missing and that declaring ALIAS
with would benefit.   

References DECL_ATTRIBUTES, DECL_SOURCE_LOCATION, decls_mismatched_attributes(), inform(), lookup_attribute(), NULL, NULL_TREE, and warning_n().

Referenced by handle_alias_pairs().

◆ merge_attributes()

tree merge_attributes ( tree a1,
tree a2 )
extern
Given two attributes lists, return a list of their union.   
Return an attribute list that is the union of a1 and a2.   

References a, attribute_list_contained(), attribute_value_equal(), copy_node(), get_attribute_name(), list_length(), lookup_ident_attribute(), NULL_TREE, and TREE_CHAIN.

Referenced by merge_decl_attributes(), and merge_type_attributes().

◆ merge_decl_attributes()

tree merge_decl_attributes ( tree olddecl,
tree newdecl )
extern
Default versions of target-overridable functions.   
Given decls OLDDECL and NEWDECL, merge their attributes and return
the result.   

References DECL_ATTRIBUTES, and merge_attributes().

◆ merge_dllimport_decl_attributes()

tree merge_dllimport_decl_attributes ( tree ,
tree  )
extern
Given two Windows decl attributes lists, possibly including
dllimport, return a list of their union .   

◆ merge_type_attributes()

tree merge_type_attributes ( tree t1,
tree t2 )
extern
Given types T1 and T2, merge their attributes and return
the result.   

References merge_attributes(), and TYPE_ATTRIBUTES.

◆ private_lookup_attribute() [1/2]

tree private_lookup_attribute ( const char * attr_name,
size_t attr_len,
tree list )
extern
The backbone of lookup_attribute().  ATTR_LEN is the string length
of ATTR_NAME, and LIST is not NULL_TREE.

The function is called from lookup_attribute in order to optimize
for size.   

References cmp_attribs(), get_attribute_name(), IDENTIFIER_LENGTH, IDENTIFIER_POINTER, and TREE_CHAIN.

Referenced by find_same_attribute(), lookup_attribute(), and lookup_attribute().

◆ private_lookup_attribute() [2/2]

tree private_lookup_attribute ( const char * attr_ns,
const char * attr_name,
size_t attr_ns_len,
size_t attr_len,
tree list )
extern
Similarly but with also attribute namespace.   

References cmp_attribs(), get_attribute_name(), get_attribute_namespace(), IDENTIFIER_LENGTH, IDENTIFIER_POINTER, NULL_TREE, and TREE_CHAIN.

◆ register_scoped_attributes()

struct scoped_attributes * register_scoped_attributes ( const scoped_attribute_specs & specs,
bool ignored_p )
extern
Insert SPECS into its namespace.  IGNORED_P is true iff all unknown
attributes in this namespace should be ignored for the purposes of
-Wattributes.  The function returns the namespace into which the
attributes have been registered.   

References scoped_attributes::attribute_hash, scoped_attributes::attributes, attributes_table, find_attribute_namespace(), gcc_assert, scoped_attributes::ignored_p, scoped_attributes::ns, NULL, register_scoped_attribute(), and specs.

Referenced by handle_ignored_attributes_option(), and init_attributes().

◆ remove_attribute() [1/2]

tree remove_attribute ( const char * attr_ns,
const char * attr_name,
tree list )
extern
Similarly but also with specific attribute namespace.   
Similarly but also match namespace on the removed attributes.
ATTR_NS "" stands for NULL or "gnu" namespace.   

References gcc_checking_assert, get_attribute_name(), is_attribute_namespace_p(), is_attribute_p(), NULL, and TREE_CHAIN.

◆ remove_attribute() [2/2]

◆ restrict_type_identity_attributes_to()

tree restrict_type_identity_attributes_to ( tree attrs,
tree ok_attrs )
extern
Remove attributes that affect type identity from ATTRS unless the
same attributes occur in OK_ATTRS.   

References lookup_attribute(), remove_attributes_matching(), simple_cst_equal(), TREE_CHAIN, and TREE_VALUE.

◆ simple_cst_list_equal()

bool simple_cst_list_equal ( const_tree l1,
const_tree l2 )
extern
Compare two constructor-element-type constants.  Return 1 if the lists
are known to be equal; otherwise return 0.   

References NULL_TREE, simple_cst_equal(), TREE_CHAIN, and TREE_VALUE.

Referenced by attribute_value_equal().

◆ sorted_attr_string()

char * sorted_attr_string ( tree arglist)
extern
ARGLIST is the argument to target attribute.  This function tokenizes
the TARGET_CLONES_ATTR_SEPARATOR separated arguments, sorts them and
returns a string which is a unique identifier for the
TARGET_CLONES_ATTR_SEPARATOR separated arguments.  It also replaces
non-identifier characters "=,-" with "_".   

References attr_strcmp(), i, NULL, qsort, TARGET_CLONES_ATTR_SEPARATOR, TREE_CHAIN, TREE_STRING_POINTER, and TREE_VALUE.

Referenced by common_function_versions().