[cfe-dev] Using Clang for a C Refactoring Tool

Mike Stump mrs at apple.com
Thu Apr 10 12:39:00 PDT 2008


On Apr 10, 2008, at 2:46 AM, pingu219 at gmail.com wrote:
> I'm currently an student doing a project which involves creating a
> program capable of representing a C project (files, functions...etc)
> visually and which will allow the user to perform simple higher as
> well as lower-level refactorings via the graphical interface itself.

Sounds cool.

> I originally intended to use the GCC translation framework available
> with ANTLR for the job of parsing the C files and source code in but
> someone else recommended that I perhaps consider Clang instead.

llvm actually targets keeping enough information around so that  
refactoring is possible and easy to do.  There is enough beef in there  
to handle comments, whitespacing, macros and so on.  Additionally, I  
suspect we'd welcome code to do more in this area into the tree.  I  
think clang would be a good place to do this.

Also, because clang (and llvm) is built and designed as a set of  
useful libraries for solving all sorts of problem, if there is a rough  
area where the design could be improved to meet your specific needs, I  
think we are interested in have that flexibility in clang.



More information about the cfe-dev mailing list