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

Schlottke, Michael m.schlottke at fz-juelich.de
Sun Dec 29 03:46:27 PST 2013

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://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?


Michael Schlottke

SimLab Highly Scalable Fluids & Solids Engineering
Jülich Supercomputing Centre (JSC)
Forschungszentrum Jülich GmbH
52425 Jülich

Phone: +49 (2461) 61 2326
Mail: m.schlottke at fz-juelich.de<mailto:m.schlottke at fz-juelich.de>
Web: 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/f92e6613/attachment.html>

More information about the cfe-dev mailing list