[cfe-dev] Converting a Clang tool that uses Libooling to a Clang plugin

Sandeep K Chaudhary babbusandy2006 at gmail.com
Mon Aug 4 14:18:09 PDT 2014


Thanks for the reply, Manuel !

Yes, I got it. It can be converted.

Thanks and regards,
Sandeep.


On Mon, Aug 4, 2014 at 8:55 AM, Manuel Klimek <klimek at google.com> wrote:

> On Tue, Jul 15, 2014 at 5:07 AM, Sandeep K Chaudhary <
> babbusandy2006 at gmail.com> wrote:
>
>> Hi Guys,
>>
>> I have written a tool that uses Clang Libtooling, and performs some
>> instrumentation on the source code. It basically inspects all the
>> global defs in the AST and inserts the instrumentation code. The
>> original source files are over-written with the help of 'Rewriter'
>> class.
>>
>> The tool reads the list of functions to instrument from an input file,
>> and also generates a couple of header files with the required
>> definitions for the instrumentation calls. It opens two o/p file
>> streams to write to the header files.
>>
>> I wish to convert this tool to a Clang plugin so that I can use
>> command line options during the build process. This way, I won't have
>> to run the tool separately before building.
>>
>> Can someone please let me know how easy/difficult is it going to be? I
>> hope that it is possible.
>>
>
> Should be pretty easy - the plugin is based on the frontend action, just
> like the libtooling stuff. Main problem will be to manage the new files you
> generate within your build system.
>
>
>>
>> Thanks and regards,
>> Sandeep.
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
>


-- 
Thanks and regards,
Sandeep K Chaudhary.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140804/b682d20b/attachment.html>


More information about the cfe-dev mailing list