[cfe-dev] converting a LibTooling tool to a library

Eric Schulte schulte.eric at gmail.com
Fri Oct 26 08:48:05 PDT 2012


Hi,

I've written a simple command-line code-mutation tool using the Tooling
infrastructure [1].  The tooling framework handled many of the difficult
portions of this task (handling compilation databases etc...) allowing
me to focus on writing a RecursiveASTVisitor -- my thanks to everyone
who worked on the tooling setup and on clang in general.

I would now like to expose the functionality of this ASTVisitor as a C
library so that I can call these functions programatically and chain
multiple ASTConsumers without the overhead of multiple shell calls,
repeatedly parsing of the original source, etc...

Is this possible?  Is this difficult?  Is there a best practice for
transitioning from a command-line Tooling tool to a library?  Should I
just look though the clang/Tooling source?  Any pointers or suggestions
would be greatly appreciated.

Thanks,

Footnotes: 
[1]  https://github.com/eschulte/clang-mutate

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



More information about the cfe-dev mailing list