attribute data structure rewrite
Geoffrey Keating
geoffk@apple.com
Fri Sep 24 06:52:00 GMT 2004
On 23/09/2004, at 5:05 PM, Andrew Pinski wrote:
>
> On Sep 23, 2004, at 7:54 PM, Geoffrey Keating wrote:
>
>> As a precondition for other compile speed improvements, I've been
>> rewriting the way that GCC represents attributes. The result is a
>> medium-size patch that touches every language and many targets (a
>> surprising number of targets don't define any special attributes at
>> all).
>>
>> The basic principle is that DECL_ATTRIBUTES and TREE_ATTRIBUTES now
>> point to an attribute_list:
>>
>> /* A structure representing 'attributes' on a DECL or TYPE node.
>> Each attribute has a NAME (an IDENTIFIER_NODE) and possibly a
>> VALUE. */
>> struct one_attribute GTY(())
>> {
>> tree name;
>> tree value;
>> };
>
> Shouldn't name be redefined as char* as you don't really need a full
> IDENTIFIER_NODE?
> Yes I know that correctly it is not but I would suspect that it would
> give a good
> speedup as you don't need to allocate as many trees as before.
I thought of that, but I suspect it's better to go the other way: make
'name' always be the *same* IDENTIFIER_NODE for a particular kind of
attribute, so you can just compare pointers. You do always have to
allocate one, because 'name' will come from a token in user code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2408 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20040924/e9e9d0d3/attachment.p7s>
More information about the Gcc
mailing list