diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-10-04 23:13:15 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-10-04 23:13:15 +0200 |
commit | 0764dc8537a4f87089ecd32391cb5f8803b43c96 (patch) | |
tree | 2169229a28047b57f0e49d606d9756f8923cd86c /COPYING | |
parent | ade1e0d5896221500d1cbda38cd631cf80325aaa (diff) | |
download | gcc-0764dc8537a4f87089ecd32391cb5f8803b43c96.zip gcc-0764dc8537a4f87089ecd32391cb5f8803b43c96.tar.gz gcc-0764dc8537a4f87089ecd32391cb5f8803b43c96.tar.bz2 |
attribs: Add overloads with namespace name
I've discovered a problem with the way we handle scoped attributes. For
declaration or type attributes for attributes we don't know anything about
we just don't add them to the declarations or types, so later in the FEs and
middle-end it is fine to use lookup_attribute etc. which just check the
attribute name and not namespace because non-standard non-GNU attributes
just won't show there. But in the case of attributes on statements, nothing
has filtered out the unknown attributes, so with my earlier assume
attribute patch e.g. c-c++-common/Wno-attributes-6.c test failed because
it uses:
[[vendor::assume(1 + 1 == 2)]];
with -Wno-attributes=vendor::assume and lookup_attribute ("assume", )
finds such attribute and handled it that way.
So, for those cases, this patch introduces lookup_attribute and
remove_attribute overloads which specify also the namespace.
I think the fallthrough, hot, cold, likely, unlikely attribute handling
will need to use the new APIs too, so that we don't handle
msft::fallthrough attribute as something we'd know.
2022-10-04 Jakub Jelinek <jakub@redhat.com>
* attribs.h (remove_attribute): Declare overload with additional
attr_ns argument.
(private_lookup_attribute): Declare overload with additional
attr_ns and attr_ns_len arguments.
(lookup_attribute): New overload with additional attr_ns argument.
* attribs.cc (remove_attribute): New overload with additional
attr_ns argument.
(private_lookup_attribute): New overload with additional
attr_ns and attr_ns_len arguments.
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions