[cfe-dev] Adding a new attribute

Douglas Gregor dgregor at apple.com
Thu Aug 26 07:29:26 PDT 2010


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





More information about the cfe-dev mailing list