[cfe-dev] Custom pragmas in Clang

Tarun Prabhu via cfe-dev cfe-dev at lists.llvm.org
Tue Sep 22 10:40:02 PDT 2015


I am trying to enable some source-to-source transformations which are
enabled using pragmas. I mostly just want insert calls to a library
whenever I encounter a pragma. For example something like this

> #pragma callout
> x = foo();

would become:

> mylibrary::callout();
> x = foo();

Is it possible to implement something like this as a Clang plugin or using
the libtooling interface? I know how to hijack documentation comments to
make this possible, but I would prefer to use a pragma. I would rather
avoid modifying clang itself to enable this.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150922/c2718def/attachment.html>

More information about the cfe-dev mailing list