Adding a new attribute

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding a new attribute

Raj Barik
Hi, 

Are there any documents on how to add a new attribute to CLANG? I am also
interested in generating a new function annotation corresponding to this attribute
in the LLVM IR. Can someone point me to some docs or code sequence to 
look at?

Best Regards,
Raj

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Adding a new attribute

Douglas Gregor

On Aug 23, 2010, at 10:33 AM, Raj Barik wrote:

> Hi,
>
> Are there any documents on how to add a new attribute to CLANG? I am also
> interested in generating a new function annotation corresponding to this attribute
> in the LLVM IR. Can someone point me to some docs or code sequence to
> look at?

There's no documentation on adding attributes, and although the situation has improved a bit---see include/clang/Basic/Attr.td for examples on how to get started---you're still going to have to add code in quite a few places in Clang. I suggest picking an attribute that is similar to what you want (e.g., applies to the same kinds of entities) and follow it through Clang.

        - Doug


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev