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

Schlottke, Michael m.schlottke at fz-juelich.de
Sun Dec 29 10:24:37 PST 2013


Hi David,

Thanks for the fast reply.

>From your description I infer that clang-fixit is a tool for enforcing a certain naming convention, rather than changing specific names, or did I misunderstand you?

However, maybe it could be a place for me to start looking for ideas... The only reference I found to clang-fixit is http://llvm-reviews.chandlerc.com/D51, but nothing in the llvm or clang/extra repository. Could you tell me where I can find more information on it?

Regards,

Michael



-------- Ursprüngliche Nachricht --------
Von: dblaikie at gmail.com
Datum:
An: "Schlottke, Michael" <m.schlottke at fz-juelich.de>,cfe-dev Developers <cfe-dev at cs.uiuc.edu>,djasper at google.com,klimek at google.com
Betreff: [cfe-dev] LibTooling vs. LibClang+Python for simple refactoring


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<mailto: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<mailto:m.schlottke at fz-juelich.de>@<mailto:m.schlottke at fz-juelich.de>fz<mailto:m.schlottke at fz-juelich.de>-<mailto:m.schlottke at fz-juelich.de>juelich.de<mailto: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/219dc7b4/attachment.html>


More information about the cfe-dev mailing list