[cfe-dev] Front-end with support for custom __attribute__'s
Konstantin Tokarev
annulen at yandex.ru
Thu Mar 17 12:57:39 PDT 2011
17.03.2011, 20:42, "Douglas Gregor" <dgregor at apple.com>:
> On Mar 17, 2011, at 4:59 AM, Konstantin Tokarev wrote:
>
>> Is it possible to create custom Clang frontend supporting new types of __attribute__ without
>> modification of Clang libraries?
>>
>> As for attributes, I've read "How to add an attribute" manual, but (AFAIU) it requires modification
>> of Sema::Kind enum, and even if I inherit from Sema, I won't be able to replace existing Kind
>> without breaking API compatibility of my Sema derivative with other libraries.
>
> You might be able to use the "annotate" attribute for what you're doing. If that doesn't work, then the answer is "no": attributes need to have explicit code to support them in the parser, sema, AST, and code generator.
Thank you for your help. I hope "annotate" will work for me.
--
Regards,
Konstantin
More information about the cfe-dev
mailing list