[cfe-dev] LibTooling vs. LibClang+Python for simple refactoring

Manuel Klimek klimek at google.com
Sun Dec 29 09:27:23 PST 2013


As David says, LibTooling was made for this task - I myself don't have a
deep understanding of how easy those things would be to do with libclang -
you might need to expose some interfaces that are not exposed yet (that
might be a great contribution to the clang community if you happen to try
that route ;)

Cheers,
/Manuel


On Sun, Dec 29, 2013 at 5:52 PM, dblaikie at gmail.com <dblaikie at gmail.com>wrote:

> Tooling, specifically the clang-fixit till is one place sheet efforts are
> being made to apply these kinds of refractoriness (specifically clang-fixit
> would apply predefined naming convention rules, rather than user specified
> renaming).
>
> One of the things that tooling might help you with would be the necessary
> reformatting (clang-format) and build/source discovery.
>
> On Sunday, December 29, 2013 3:49:06 AM, Schlottke, Michael <
> m.schlottke at fz-juelich.de> wrote:
>
> Hi everyone,
>
> For our research group, I need to get started with some relatively simple
> refactoring tasks in a modestly complex C++ project. The goal is to have a
> tool that (in the beginning) is good for at least two things:
> - renaming member variables/methods
> - replacing member variable access by getters/setters
>
> After the extremely positive experiences I've had with clang (and since
> the IDE tools I tried failed for our project), I'd like to utilize the
> clang infrastructure for this task. However, in the very beginning I
> already face the problem of where I should start:
>
> On the one hand, LibTooling seems to be the interface of choice when it
> comes to refactoring code (it's one of the canonical examples on http://<http://clang.llvm.org/docs/Tooling.html>
> clang.llvm.org <http://clang.llvm.org/docs/Tooling.html>/docs/<http://clang.llvm.org/docs/Tooling.html>
> Tooling.html <http://clang.llvm.org/docs/Tooling.html>). On the other
> hand libclang seems to be easier to use, has Python bindings, and from the
> outset looks like it could be already sufficient for the task at hand.
>
> Do you have any experience/recommendations for which library is the one to
> use in this case?
>
> Regards,
>
> Michael
>
> --
> Michael Schlottke
>
> SimLab Highly Scalable Fluids & Solids Engineering
> Jülich Supercomputing Centre (JSC)
> Forschungszentrum Jülich GmbH
> 52425 Jülich
> Germany
>
> Phone: +49 (2461) 61 2326
> Mail: m.schlottke <m.schlottke at fz-juelich.de>@ <m.schlottke at fz-juelich.de>
> fz <m.schlottke at fz-juelich.de>- <m.schlottke at fz-juelich.de>juelich.de<m.schlottke at fz-juelich.de>
> Web: http:// <http://www.fz-juelich.de/jsc>www.fz<http://www.fz-juelich.de/jsc>
> - <http://www.fz-juelich.de/jsc>juelich.de <http://www.fz-juelich.de/jsc>/<http://www.fz-juelich.de/jsc>
> jsc <http://www.fz-juelich.de/jsc>
>
>
>
> ------------------------------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------------------------
> Forschungszentrum Juelich GmbH
> 52425 Juelich
> Sitz der Gesellschaft: Juelich
> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
> Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
> Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
> Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
> Prof. Dr. Sebastian M. Schmidt
>
> ------------------------------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------------------------
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131229/317b1001/attachment.html>


More information about the cfe-dev mailing list