[cfe-dev] improve attributes handling in clang
Michael Han
Michael.Han at autodesk.com
Thu Dec 2 01:55:46 PST 2010
I think one improvement would be to move the AttributeList::Kind in Sema into td file so codes like AttributeList::getKind can be generated through tblgen. If this is done then adding an implementation defined (gnu style) attribute would only require user modify the attribute table definition file (with user's code to handle attributes in Sema but that's not part of infrastructure anyway). Currently when we add our attributes we need to visit several places in Sema to fix the boilerplate code.
Cheers
~Michael
-----Original Message-----
From: Sean Hunt [mailto:rideau3 at gmail.com]
Sent: Thursday, December 02, 2010 3:37 PM
To: Douglas Gregor
Cc: Michael Han; cfe-dev at cs.uiuc.edu; Hippocrates code verification project
Subject: Re: improve attributes handling in clang
On 10-12-01 02:38 PM, Douglas Gregor wrote:
>
> On Nov 22, 2010, at 11:24 PM, Michael Han wrote:
>
>> Hi Doug,
>> I have a question on the plan of improving attribute handling in
>> clang. I am aware that the attribute handling has been improved a lot
>> with Sean’s work by using tblgen to generate boilerplate code such
>> that getting attributes from source to AST is almost fully automated.
>> My question is, is there any plan and / or work to finish, in order to
>> further improve the attribute handling in clang? For example, I
>> noticed getting attributes from source to Sema still requires manually
>> modifying the AttributeList in Sema (although the modification is
>> quite trivial), which might be another place that can be automated
>> using tblgen.
>
> I'd love to see further improvements to attribute handling along the
> lines of what was in Sean's GSoC proposal, but I personally don't plan
> to work on this. Sean, are you planning to continue working on attributes?
>
>> The motivation is we at Autodesk are developing a static code analyzer
>> that checks function call graph through annotated GNU-style attributes
>> acting as metadata associated with the function types and we are
>> interested in improving attributes handling in clang to make it even
>> more easier for user to add implementation defined attributes. Any
>> suggestions and guidance on potential improvements are appreciated.
>
> The major improvements I'd still like to see are to automatically
> generate the parser for attributes (based on the .td file) and to do
> basic semantic checking + adding attributes to AST nodes (also based on
> the .td file).
>
> - Doug
Yes, I am absolutely intending to finish what was done. Classes end next
week, and then I should have much more free time to rewrite the work I'd
done to be compatible with the new Sema/Parser divide.
Sean
More information about the cfe-dev
mailing list