diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2023-12-02 13:49:55 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2023-12-02 13:49:55 +0000 |
commit | df4643f90c45db2501c731d4fded60dc1426b484 (patch) | |
tree | 07bf19d5e16ea2972ea7571db023bd66524a6196 | |
parent | f8135a5aefe7c9f79b7d6b416a2bb6cb5ac0b134 (diff) | |
download | gcc-df4643f90c45db2501c731d4fded60dc1426b484.zip gcc-df4643f90c45db2501c731d4fded60dc1426b484.tar.gz gcc-df4643f90c45db2501c731d4fded60dc1426b484.tar.bz2 |
attribs: Namespace-aware lookup_attribute_spec
attribute_ignored_p already used a namespace-aware query
to find the attribute_spec for an existing attribute:
const attribute_spec *as = lookup_attribute_spec (TREE_PURPOSE (attr));
This patch does the same for other callers in the file.
gcc/
* attribs.cc (comp_type_attributes): Pass the full TREE_PURPOSE
to lookup_attribute_spec, rather than just the name.
(remove_attributes_matching): Likewise.
-rw-r--r-- | gcc/attribs.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/attribs.cc b/gcc/attribs.cc index e2e0335..eff9900 100644 --- a/gcc/attribs.cc +++ b/gcc/attribs.cc @@ -1475,7 +1475,7 @@ comp_type_attributes (const_tree type1, const_tree type2) const struct attribute_spec *as; const_tree attr; - as = lookup_attribute_spec (get_attribute_name (a)); + as = lookup_attribute_spec (TREE_PURPOSE (a)); if (!as || as->affects_type_identity == false) continue; @@ -1489,7 +1489,7 @@ comp_type_attributes (const_tree type1, const_tree type2) { const struct attribute_spec *as; - as = lookup_attribute_spec (get_attribute_name (a)); + as = lookup_attribute_spec (TREE_PURPOSE (a)); if (!as || as->affects_type_identity == false) continue; @@ -1531,8 +1531,7 @@ remove_attributes_matching (tree attrs, Predicate predicate) const_tree start = attrs; for (const_tree attr = attrs; attr; attr = TREE_CHAIN (attr)) { - tree name = get_attribute_name (attr); - const attribute_spec *as = lookup_attribute_spec (name); + const attribute_spec *as = lookup_attribute_spec (TREE_PURPOSE (attr)); const_tree end; if (!predicate (attr, as)) end = attr; |