On 11/6/23 05:23, Richard Sandiford wrote:
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.

Admittedly I'm just going off gut instinct here.  I'm happy to drop
the patch if this doesn't seem worth a new GC root.

Tested on aarch64-linux-gnu & x86_64-linux-gnu.  OK to install?

Richard

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.
I trust your gut instincts.  So OK.

jeff

Reply via email to