[cfe-dev] Query about new Attribute plugin API Capabilities

Abelenda Diego via cfe-dev cfe-dev at lists.llvm.org
Wed May 20 00:20:52 PDT 2020


Hello here,

I was really happy to see the new Attribute plugin API in clang because I had
an idea for a long time and needing to patch every version of clang would have
been hard.
Now that it is being released (soon), I was wondering what are its
possibilities.

So I was wondering if it would be possible to add new definitions
(functions, structs, calls to functions, etc) using attributes? My goal is to
auto-generate definitions using annotations (like runtime syntaxic/semantic
checking of values of a parameter, to a function etc) I know this is an abuse
of the annotation syntax, but it is not explicitly forbidden AFAIK, and it seems
easier to add annotations than to add new custom syntax (basically forking the
C language itself).

I'm not quite clear on how to put everything together. Mostly where to create
the new FunctionDecl & co to integrate correctly with the semantic checking.

Best Regards,
Diego Abelenda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200520/0b83315b/attachment.sig>


More information about the cfe-dev mailing list