]> git.ipfire.org Git - thirdparty/gcc.git/commit
attribs: Cache the gnu namespace
authorRichard Sandiford <richard.sandiford@arm.com>
Sat, 2 Dec 2023 13:49:54 +0000 (13:49 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Sat, 2 Dec 2023 13:49:54 +0000 (13:49 +0000)
commit3956f5146dc13aa72977c222cfe472ba1e92834c
treede25f56cf6e949b8344be2a47469d8059c85d077
parent301dec8533460152c4dd61f46c8e9276e169c49a
attribs: Cache the gnu namespace

Later patches add more calls to get_attribute_namespace.
For scoped attributes, this is a simple operation on tree pointers.
But for normal GNU attributes (the vast majority), it involves a
call to get_identifier ("gnu").  This patch caches the identifier
for speed.

gcc/
* Makefile.in (GTFILES): Add attribs.cc.
* attribs.cc (gnu_namespace_cache): New variable.
(get_gnu_namespace): New function.
(lookup_attribute_spec): Use it instead of get_identifier ("gnu").
(get_attribute_namespace, attribs_cc_tests): Likewise.
gcc/Makefile.in
gcc/attribs.cc