GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "target.h"
#include "tree.h"
#include "stringpool.h"
#include "diagnostic-core.h"
#include "attribs.h"
#include "fold-const.h"
#include "ipa-strub.h"
#include "stor-layout.h"
#include "langhooks.h"
#include "plugin.h"
#include "selftest.h"
#include "hash-set.h"
#include "diagnostic.h"
#include "pretty-print.h"
#include "pretty-print-markup.h"
#include "tree-pretty-print.h"
#include "intl.h"
#include "gcc-urlifier.h"
#include "gt-attribs.h"
Data Structures | |
struct | substring |
struct | attribute_hasher |
struct | scoped_attributes |
Macros | |
#define | INCLUDE_STRING |
Variables | |
static array_slice< const scoped_attribute_specs *const > | attribute_tables [2] |
static vec< scoped_attributes > | attributes_table |
static bool | attributes_initialized = false |
static tree | gnu_namespace_cache |
static vec< attribute_spec * > | ignored_attributes_table |
#define INCLUDE_STRING |
Functions dealing with attribute handling, used by most front ends. Copyright (C) 1992-2024 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/>.
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().
Return true if the ATTRS chain contains at least one attribute which is not ignored.
References attribute_ignored_p(), and TREE_CHAIN.
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().
Return true iff we should not complain about unknown attributes coming from the attribute namespace NS. This is the case for the -Wno-attributes=ns:: command-line option.
References find_attribute_namespace(), IDENTIFIER_POINTER, NULL_TREE, and r.
Referenced by attribute_ignored_p(), and decl_attributes().
|
static |
Common functions used for target clone support.
Comparator function to be used in qsort routine to sort attribute specification strings to "target".
Referenced by sorted_attr_string().
bool attribute_ignored_p | ( | const attribute_spec *const | as | ) |
Like above, but takes an attribute_spec AS, which must be nonnull.
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().
int attribute_list_contained | ( | const_tree | l1, |
const_tree | l2 ) |
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().
int attribute_list_equal | ( | const_tree | l1, |
const_tree | l2 ) |
Given two lists of attributes, return true if list l2 is equivalent to l1.
References attribute_list_contained().
Referenced by build_type_attribute_qual_variant(), check_aligned_type(), check_base_type(), ipa_icf::sem_item::compare_referenced_symbol_properties(), type_cache_hasher::equal(), and ipa_icf::sem_function::equals_wpa().
bool attribute_value_equal | ( | const_tree | attr1, |
const_tree | attr2 ) |
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().
Return a declaration like DDECL except that its DECL_ATTRIBUTES is ATTRIBUTE.
References DECL_ATTRIBUTES.
Return a type like TTYPE except that its TYPE_ATTRIBUTE is ATTRIBUTE and its qualifiers are QUALS. Record such modified types already made so we don't make duplicates.
References attribute_list_equal(), build_distinct_type_copy(), build_qualified_type(), comp_type_attributes(), lang_hooks_for_types::copy_lang_qualifiers, RECORD_OR_UNION_TYPE_P, SET_TYPE_STRUCTURAL_EQUALITY, TREE_CODE, TYPE_ATTRIBUTES, TYPE_CANONICAL, type_hash_canon(), type_hash_canon_hash(), TYPE_MAIN_VARIANT, TYPE_QUALS, TYPE_STRUCTURAL_EQUALITY_P, TYPE_UNQUALIFIED, lang_hooks::types, and warning().
Referenced by attr_access::array_as_string(), build_type_attribute_variant(), make_vector_type(), reconstruct_complex_type(), and remap_type_1().
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().
|
static |
Make some sanity checks on the attribute tables.
References attribute_tables, scoped_attributes::attributes, gcc_assert, gcc_unreachable, names, and scoped_attributes::ns.
Referenced by init_attributes().
|
static |
Compare two identifier nodes representing attributes. Return true if they are the same, false otherwise.
References cmp_attribs(), gcc_checking_assert, IDENTIFIER_LENGTH, IDENTIFIER_POINTER, and TREE_CODE.
Referenced by attribute_value_equal(), and lookup_ident_attribute().
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.
int comp_type_attributes | ( | const_tree | type1, |
const_tree | type2 ) |
Return 0 if the attributes for two types are incompatible, 1 if they are compatible, and 2 if they are nearly compatible (which causes a warning to be generated).
References a, attribute_value_equal(), CONST_CAST_TREE, find_same_attribute(), gcc_unreachable, lookup_attribute(), lookup_attribute_spec(), NULL, NULL_TREE, strub_comptypes(), targetm, TREE_CHAIN, TREE_PURPOSE, and TYPE_ATTRIBUTES.
Referenced by build_type_attribute_qual_variant(), ipa_icf_gimple::func_checker::compare_gimple_call(), ipa_icf::sem_item::compare_referenced_symbol_properties(), ipa_icf::sem_function::equals_wpa(), type_variants_equivalent_p(), and useless_type_conversion_p().
void copy_attributes_to_builtin | ( | tree | decl | ) |
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().
bool cxx11_attribute_p | ( | const_tree | attr | ) |
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().
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().
unsigned decls_mismatched_attributes | ( | tree | tmpl, |
tree | decl, | ||
tree | attrlist, | ||
const char *const | blacklist[], | ||
auto_vec< const char * > & | outattrs ) |
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().
|
static |
Check LAST_DECL and NODE of the same symbol for attributes that are recorded in SPEC to be mutually exclusive with ATTRNAME, diagnose them, and return true if any have been found. NODE can be a DECL or a TYPE.
References DECL_ATTRIBUTES, DECL_P, DECL_SOURCE_LOCATION, diag_attr_exclusions(), fndecl_built_in_p(), i, inform(), is_attribute_p(), lookup_attribute(), NULL_TREE, RECORD_OR_UNION_TYPE_P, TREE_CODE, TREE_TYPE, TYPE_ATTRIBUTES, VAR_P, and warning().
Referenced by decl_attributes(), and diag_attr_exclusions().
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().
|
static |
Return the namespace which name is NS, NULL if none exist.
References attributes_table, and NULL.
Referenced by attr_namespace_ignored_p(), lookup_scoped_attribute_spec(), register_attribute(), and register_scoped_attributes().
|
static |
See whether LIST contains at least one instance of attribute ATTR (possibly with different arguments). Return the first such attribute if so, otherwise return null.
References get_attribute_name(), get_attribute_namespace(), IDENTIFIER_LENGTH, IDENTIFIER_POINTER, NULL_TREE, and private_lookup_attribute().
Referenced by comp_type_attributes(), and decl_attributes().
void free_attr_data | ( | ) |
Free data we might have allocated when adding extra attributes.
References ignored_attributes_table.
Referenced by compile_file().
tree get_attribute_name | ( | const_tree | attr | ) |
Return the name of the attribute ATTR. This accessor works on GNU and C++11 (scoped) attributes. Please read the comments of cxx11_attribute_p to understand the format of attributes.
References cxx11_attribute_p(), TREE_PURPOSE, and TREE_VALUE.
Referenced by attribute_list_contained(), attribute_value_equal(), build_adjusted_function_type(), compute_fn_summary(), create_omp_child_function(), cgraph_node::create_version_clone_with_body(), decl_attributes(), dump_function_to_file(), find_same_attribute(), function_attribute_inlinable_p(), lookup_attribute_by_prefix(), lookup_ident_attribute(), merge_attributes(), private_lookup_attribute(), private_lookup_attribute(), remove_attribute(), remove_attribute(), and type_hash_canon_hash().
tree get_attribute_namespace | ( | const_tree | attr | ) |
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().
|
static |
Return the IDENTIFIER_NODE for the gnu namespace.
References get_identifier(), and gnu_namespace_cache.
Referenced by get_attribute_namespace(), and lookup_attribute_spec().
attr_access * get_parm_access | ( | rdwr_map & | rdwr_idx, |
tree | parm, | ||
tree | fndecl ) |
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().
void handle_ignored_attributes_option | ( | vec< char * > * | v | ) |
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().
Return true if the function decl or type NODE has been declared with attribute ANAME among attributes ATTRS.
References DECL_IS_MALLOC, DECL_P, DECL_PURE_P, lookup_attribute(), TREE_NOTHROW, TREE_READONLY, and TREE_THIS_VOLATILE.
Referenced by decls_mismatched_attributes().
Initialize a mapping RWM for a call to a function declared with attribute access in ATTRS. Each attribute positional operand inserts one entry into the mapping with the operand number as the key.
References copy_list(), attr_access::end, end(), attr_access::from_mode_char(), gcc_assert, hash_map< KeyId, Value, Traits >::get_or_insert(), HOST_WIDE_INT_M1U, attr_access::internal_p, lookup_attribute(), attr_access::minsize, attr_access::mode, nreverse(), NULL, attr_access::ptrarg, hash_map< KeyId, Value, Traits >::put(), attr_access::sizarg, attr_access::size, attr_access::static_p, attr_access::str, TREE_CHAIN, TREE_CODE, TREE_STRING_POINTER, TREE_VALUE, and UINT_MAX.
Referenced by get_parm_access(), maybe_warn_pass_by_reference(), and maybe_warn_read_write_only().
void init_attributes | ( | void | ) |
Initialize attribute tables, and make some sanity checks if checking is enabled.
References lang_hooks::attribute_table, attribute_tables, attributes_initialized, check_attribute_tables(), handle_ignored_attributes_option(), invoke_plugin_callbacks(), NULL, register_scoped_attributes(), and targetm.
Referenced by decl_attributes().
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.
const struct attribute_spec * lookup_attribute_spec | ( | const_tree | name | ) |
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().
A variant of lookup_attribute() that can be used with an identifier as the first argument, and where the identifier can be either 'text' or '__text__'. Given an attribute ATTR_IDENTIFIER, 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_IDENTIFIER must be an identifier but can be in the form 'text' or '__text__'.
References cmp_attrib_identifiers(), gcc_checking_assert, get_attribute_name(), TREE_CHAIN, and TREE_CODE.
Referenced by attribute_list_contained(), and merge_attributes().
|
static |
Return the spec for the scoped attribute with namespace NS and name NAME.
References attrs, find_attribute_namespace(), IDENTIFIER_LENGTH, IDENTIFIER_POINTER, substring::length, NULL, NULL_TREE, substring::str, and substring_hash().
Referenced by decl_attributes(), handle_ignored_attributes_option(), and lookup_attribute_spec().
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 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.
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().
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().
Given decls OLDDECL and NEWDECL, merge their attributes and return the result.
References DECL_ATTRIBUTES, and merge_attributes().
Given types T1 and T2, merge their attributes and return the result.
References merge_attributes(), and TYPE_ATTRIBUTES.
Check if "omp declare simd" attribute arguments, CLAUSES1 and CLAUSES2, are the same.
References OMP_CLAUSE_ALIGNED, OMP_CLAUSE_ALIGNED_ALIGNMENT, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LINEAR, OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_SIMDLEN_EXPR, and simple_cst_equal().
Referenced by attribute_value_equal().
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().
tree private_lookup_attribute | ( | const char * | attr_ns, |
const char * | attr_name, | ||
size_t | attr_ns_len, | ||
size_t | attr_len, | ||
tree | list ) |
Similarly but with also attribute namespace.
References cmp_attribs(), get_attribute_name(), get_attribute_namespace(), IDENTIFIER_LENGTH, IDENTIFIER_POINTER, NULL_TREE, and TREE_CHAIN.
void register_attribute | ( | const struct attribute_spec * | attr | ) |
Insert a single ATTR into the attribute table.
References find_attribute_namespace(), and register_scoped_attribute().
|
static |
Insert a single attribute ATTR into a namespace of attributes.
References scoped_attributes::attribute_hash, canonicalize_attr_name(), CONST_CAST, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), gcc_assert, gcc_checking_assert, NULL, substring::str, and substring_hash().
Referenced by register_attribute(), and register_scoped_attributes().
scoped_attributes * register_scoped_attributes | ( | const scoped_attribute_specs & | specs, |
bool | ignored_p ) |
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 any instances of attribute ATTR_NAME in LIST and return the modified list.
References gcc_checking_assert, get_attribute_name(), is_attribute_p(), and TREE_CHAIN.
Referenced by create_omp_child_function(), expand_omp_target(), gimplify_bind_expr(), symtab_node::make_decl_local(), omp_discover_declare_target_var_r(), optimize_weakref(), process_common_attributes(), process_function_and_variable_attributes(), and symbol_table::remove_unreachable_nodes().
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.
PREDICATE acts as a function of type: (const_tree attr, const attribute_spec *as) -> bool where ATTR is an attribute and AS is its possibly-null specification. Return a list of every attribute in attribute list ATTRS for which PREDICATE is true. Return ATTRS itself if PREDICATE returns true for every attribute.
References attrs, end(), gcc_assert, lookup_attribute_spec(), NULL_TREE, TREE_CHAIN, tree_cons(), TREE_PURPOSE, and TREE_VALUE.
Referenced by affects_type_identity_attributes(), and restrict_type_identity_attributes_to().
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.
bool simple_cst_list_equal | ( | const_tree | l1, |
const_tree | l2 ) |
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().
char * sorted_attr_string | ( | tree | arglist | ) |
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().
|
inlinestatic |
Simple hash function to avoid need to scan whole string.
Referenced by attribute_hasher::hash(), lookup_scoped_attribute_spec(), and register_scoped_attribute().
|
static |
Table of the tables of attributes (common, language, format, machine) searched.
Referenced by check_attribute_tables(), and init_attributes().
Referenced by decl_attributes(), and init_attributes().
|
static |
The table of scope attributes.
Referenced by find_attribute_namespace(), and register_scoped_attributes().
|
static |
Do not use directly; go through get_gnu_namespace instead.
Referenced by get_gnu_namespace().
|
static |
Used to stash pointers to allocated memory so that we can free them at the end of parsing of all TUs.
Referenced by free_attr_data(), and handle_ignored_attributes_option().