[cfe-dev] Getting involved with Clang refactoring
klimek at google.com
Sat May 19 16:14:34 PDT 2012
On Fri, May 18, 2012 at 5:21 PM, Douglas Gregor <dgregor at apple.com> wrote:
> On May 18, 2012, at 12:11 AM, David Wood <dswood at gmail.com> wrote:
>> I just attended Chandler Carruth's talk at C++ Now about using clang to develop refactoring tools. As they say on the internets "Your ideas intrigue me and I would like to subscribe to your newsletter."
>> I believe that refactoring tools can be groundbreaking for C++ and would like to contribute. I'm particularly interested in getting the tools hooked into IDEs (many years ago I worked on a refactoring plugin for JBuilder), but it sounds like there's lots of work to be done before that. How can I get started, and what most needs to be worked on?
> Arnaud's links point at the tooling infrastructure, which is intended for building standalone refactoring and source-based tools.
> For IDE-centric tools, libclang
> is a C interface to Clang that focuses on the things that IDEs like to do: syntax highlighting, indexing, code completion, finding all of the references to a given declaration within a file, finding out what your cursor is pointing to, etc. I gave an introductory talk on libclang at the 2010 LLVM Developer Meeting which might be helpful:
> If your primary interest is in IDEs, I suggest wiring up libclang to your favorite open-source IDE. There are various Vim and Emacs libclang bindings running around, for example, although I don't know which are best. Personally, I think it would be awesome if we could have easy-to-install, libclang-based packages for vim and emacs that were maintained along with Clang and got all of the new libclang goodness. Once you've played with libclang's integration, I'm sure you'll find something that needs improvement, and we can point you at that code if you don't find it yourself.
> If your primary interest is in refactoring, Arnaud's links to tooling are a good place to start, because it's starting to collect the pieces needed to make refactoring easier.
Btw, the first link (http://clang.llvm.org/docs/Tooling.html) contains
a discussion about the different frameworks. If you think I haven't
mentioned some stuff about libclang on there (or got some wrong), let
me know and I'll add to it.
And while I'm at it. One thing that might be interesting for a
contribution is getting the compilation database support up for
libclang (not sure how Doug thinks about this, but I'm sure he'll jump
in ;) One of the problems I have with the libclang plugins I know is
that I need to specify "one common command line".
More information about the cfe-dev