<font size=2 face="sans-serif">Just my $0.02 here - using LibClang with
Python bindings is a bit slow.</font>
<br>
<br><font size=2 face="sans-serif">On a moderate sized source file, it
can take several hundred milliseconds to parse.</font>
<br>
<br><font size=2 face="sans-serif">If I understand correctly, this is because
the parsing involves creating of many Python objects, to represent just
about everything in your AST.</font>
<br>
<br><font size=2 face="sans-serif">The size of the original source is actually
not the issue, but the size of the preprocessed source quickly becomes
very large with the inclusion of many headers.</font>
<br>
<br><font size=2 face="sans-serif">For working one-file at a time, this
is not a problem at all, however, I wrote something that uses the Python
bindings to inject custom instrumentation code, during the build of a large
project, and this slowed the build considerably.</font>
<br>
<br><font size=2 face="sans-serif">Again, just for the sake of everyone
thinking about this - I should have written that in C++ from the beginning.</font>
<br>
<br><font size=2 color=#000080 face="sans-serif">Amit Margalit</font>
<br><font size=2 color=#808000 face="sans-serif">IBM XIV </font><font size=2 face="sans-serif">-
<i>Storage Reinvented</i></font>
<br><font size=2 face="sans-serif">XIV-NAS Development Team</font>
<br><font size=2 face="sans-serif">Tel. 03</font><font size=2 face="Arial">-689-7774</font>
<br><font size=2 face="Arial">Fax. 03-689-7230</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">"dblaikie@gmail.com"
<dblaikie@gmail.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">"Schlottke, Michael"
<m.schlottke@fz-juelich.de>, cfe-dev Developers <cfe-dev@cs.uiuc.edu>,
Daniel Jasper <djasper@google.com>, Manuel Klimek <klimek@google.com>,
Sean Silva <silvas@purdue.edu></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">01/01/2014 01:26 AM</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: [cfe-dev]
LibTooling vs. LibClang+Python for simple refactoring</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by:
</font><font size=1 face="sans-serif">cfe-dev-bounces@cs.uiuc.edu</font>
<br>
<hr noshade>
<br>
<br>
<br>
<p><font size=3>On Monday, December 30, 2013 2:40:30 PM, Sean Silva <</font><a href=mailto:silvas@purdue.edu><font size=3 color=blue><u>silvas@purdue.edu</u></font></a><font size=3>>
wrote:</font>
<p><font size=3>On Mon, Dec 30, 2013 at 9:40 AM, </font><a href=mailto:dblaikie@gmail.com><font size=3 color=blue><u>dblaikie@</u></font></a><a href=mailto:dblaikie@gmail.com><font size=3 color=blue><u>gmail.com</u></font></a><font size=3>
<</font><a href=mailto:dblaikie@gmail.com><font size=3 color=blue><u>dblaikie@</u></font></a><a href=mailto:dblaikie@gmail.com><font size=3 color=blue><u>gmail.com</u></font></a><font size=3>>
wrote:</font>
<p><font size=3>On Sun Dec 29 2013 at 10:25:19 AM, Schlottke, Michael <</font><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>m.schlottke</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>@</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>fz</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>-</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>juelich.de</u></font></a><font size=3>>
wrote:</font>
<p><font size=3>Hi David, </font>
<p><font size=3>Thanks for the fast reply. </font>
<p><font size=3>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? </font>
<p><font size=3>That's correct - but it has the same challenges in terms
of resizing names, etc.</font>
<p><font size=3> </font>
<p><font size=3><br>
However, maybe it could be a place for me to start looking for ideas...
The only reference I found to clang-fixit is </font><a href="http://llvm-reviews.chandlerc.com/D51"><font size=3 color=blue><u>http://llvm-</u></font></a><a href="http://llvm-reviews.chandlerc.com/D51"><font size=3 color=blue><u>reviews.chandlerc.com</u></font></a><a href="http://llvm-reviews.chandlerc.com/D51"><font size=3 color=blue><u>/D51</u></font></a><font size=3>,
but nothing in the llvm or clang/extra repository. Could you tell me where
I can find more information on it? </font>
<p><font size=3>Hmm, perhaps it hasn't really been started yet. Sorry for
the red herring.</font>
<p><font size=3>Do you maybe mean clang-tidy? It's in clang-tools-extra
last I checked</font>
<p><font size=3><br>
<br>
Indeed I did. Thanks for the correction!</font>
<p><font size=3>-- Sean Silva</font>
<p><font size=3> </font>
<p><font size=3><br>
I would guess clang-migrate would be the next best tool to look at. It
does various code changes and deals with reformatting the resulting code,
etc.</font>
<p><font size=3>- David</font>
<p><font size=3> </font>
<p><font size=3><br>
Regards, </font>
<p><font size=3>Michael <br>
<br>
</font>
<p><font size=3>-------- Ursprüngliche Nachricht --------<br>
Von: </font><a href=mailto:dblaikie@gmail.com><font size=3 color=blue><u>dblaikie@</u></font></a><a href=mailto:dblaikie@gmail.com><font size=3 color=blue><u>gmail.com</u></font></a><font size=3>
<br>
Datum: <br>
An: "Schlottke, Michael" <</font><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>m.schlottke</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>@</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>fz</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>-</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>juelich.de</u></font></a><font size=3>>,cfe-dev
Developers <</font><a href="mailto:cfe-dev@cs.uiuc.edu"><font size=3 color=blue><u>cfe-</u></font></a><a href="mailto:cfe-dev@cs.uiuc.edu"><font size=3 color=blue><u>dev</u></font></a><a href="mailto:cfe-dev@cs.uiuc.edu"><font size=3 color=blue><u>@</u></font></a><a href="mailto:cfe-dev@cs.uiuc.edu"><font size=3 color=blue><u>cs.uiuc.edu</u></font></a><font size=3>>,</font><a href=mailto:djasper@google.com><font size=3 color=blue><u>djasper</u></font></a><a href=mailto:djasper@google.com><font size=3 color=blue><u>@</u></font></a><a href=mailto:djasper@google.com><font size=3 color=blue><u>google.com</u></font></a><font size=3>,</font><a href=mailto:klimek@google.com><font size=3 color=blue><u>klimek</u></font></a><a href=mailto:klimek@google.com><font size=3 color=blue><u>@</u></font></a><a href=mailto:klimek@google.com><font size=3 color=blue><u>google.com</u></font></a><font size=3>
<br>
Betreff: [cfe-dev] LibTooling vs. LibClang+Python for simple refactoring
<br>
</font>
<p><font size=3>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).</font>
<p><font size=3>One of the things that tooling might help you with would
be the necessary reformatting (clang-format) and build/source discovery.</font>
<p><font size=3>On Sunday, December 29, 2013 3:49:06 AM, Schlottke, Michael
<</font><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>m.schlottke</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>@</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>fz</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>-</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>juelich.de</u></font></a><font size=3>>
wrote:</font>
<p><font size=3>Hi everyone,</font>
<p><font size=3>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:<br>
- renaming member variables/methods<br>
- replacing member variable access by getters/setters</font>
<p><font size=3>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:</font>
<p><font size=3>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 </font><a href=http://clang.llvm.org/docs/Tooling.html><font size=3 color=blue><u>http://</u></font></a><a href=http://clang.llvm.org/docs/Tooling.html><font size=3 color=blue><u>clang.llvm.org</u></font></a><a href=http://clang.llvm.org/docs/Tooling.html><font size=3 color=blue><u>/docs/</u></font></a><a href=http://clang.llvm.org/docs/Tooling.html><font size=3 color=blue><u>Tooling.html</u></font></a><font size=3>).
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.</font>
<p><font size=3>Do you have any experience/recommendations for which library
is the one to use in this case?</font>
<p><font size=3>Regards,</font>
<p><font size=3>Michael</font>
<p><font size=3>--<br>
Michael Schlottke</font>
<p><font size=3>SimLab Highly Scalable Fluids & Solids Engineering<br>
Jülich Supercomputing Centre (JSC)<br>
Forschungszentrum Jülich GmbH<br>
52425 Jülich<br>
Germany</font>
<p><font size=3>Phone: +49 (2461) 61 2326<br>
Mail: </font><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>m.schlottke</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>@</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>fz</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>-</u></font></a><a href="mailto:m.schlottke@fz-juelich.de"><font size=3 color=blue><u>juelich.de</u></font></a><font size=3><br>
Web: </font><a href="http://www.fz-juelich.de/jsc"><font size=3 color=blue><u>http://</u></font></a><a href="http://www.fz-juelich.de/jsc"><font size=3 color=blue><u>www.fz</u></font></a><a href="http://www.fz-juelich.de/jsc"><font size=3 color=blue><u>-</u></font></a><a href="http://www.fz-juelich.de/jsc"><font size=3 color=blue><u>juelich.de</u></font></a><a href="http://www.fz-juelich.de/jsc"><font size=3 color=blue><u>/</u></font></a><a href="http://www.fz-juelich.de/jsc"><font size=3 color=blue><u>jsc</u></font></a>
<p><font size=3>------------------------------------------------------------------------------------------------<br>
------------------------------------------------------------------------------------------------<br>
Forschungszentrum Juelich GmbH<br>
52425 Juelich<br>
Sitz der Gesellschaft: Juelich<br>
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498<br>
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher<br>
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),<br>
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,<br>
Prof. Dr. Sebastian M. Schmidt<br>
------------------------------------------------------------------------------------------------<br>
------------------------------------------------------------------------------------------------</font>
<p>
<p>
<p>
<p><font size=3>_______________________________________________<br>
cfe-dev mailing list</font><font size=3 color=blue><u><br>
</u></font><a href="mailto:cfe-dev@cs.uiuc.edu"><font size=3 color=blue><u>cfe-</u></font></a><a href="mailto:cfe-dev@cs.uiuc.edu"><font size=3 color=blue><u>dev</u></font></a><a href="mailto:cfe-dev@cs.uiuc.edu"><font size=3 color=blue><u>@</u></font></a><a href="mailto:cfe-dev@cs.uiuc.edu"><font size=3 color=blue><u>cs.uiuc.edu</u></font></a><font size=3 color=blue><u><br>
</u></font><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev"><font size=3 color=blue><u>http://</u></font></a><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev"><font size=3 color=blue><u>lists.cs.uiuc.edu</u></font></a><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev"><font size=3 color=blue><u>/mailman/</u></font></a><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev"><font size=3 color=blue><u>listinfo</u></font></a><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev"><font size=3 color=blue><u>/cfe-</u></font></a><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev"><font size=3 color=blue><u>dev</u></font></a>
<p><tt><font size=2>_______________________________________________<br>
cfe-dev mailing list<br>
cfe-dev@cs.uiuc.edu<br>
</font></tt><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev"><tt><font size=2>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</font></tt></a><tt><font size=2><br>
</font></tt>
<p>