[cfe-dev] Indexer Library and type references....

Douglas Gregor dgregor at apple.com
Thu Oct 8 14:05:32 PDT 2009


On Oct 8, 2009, at 1:46 PM, dan chap wrote:


>
>
> --- On M
>
> Shifting namespaces sounds like a syntactic transformation rather  
> than a transformation that needs to work on the AST.
>
>
> Yes... It is syntactic...   I am working on a refactoring tool (ala  
> Netbeans Refactor/Rename) and I am using the Clang AST and indexer  
> library to produce source locations and references not only against  
> the primary project you were working on, but also within projects  
> which depend upon the primary one...
>
> For example... (this is a very simple example and not necessarily a  
> good one at that...)
>
> You have a large project which has been code reviewed and regression  
> tested to within an inch of it's life.   It uses zlib 1.1.0 and does  
> a fine job.
>
> References to zlib are sprinkled throughout hundreds of modules and  
> locations.
>
> Now, a new version of zlib is available: 1.2.3 and you need it's  
> functionality for an additional module being created in the project.
>
> By massively refactoring the source code of zlib 1.2.3 to a new  
> namespace (not C++ , just plain vanilla C) so that you get something  
> like zlib_123_deflate(), you will not namespace collisions between  
> the old and new zlib when linking.
>
> We have preserved our code reviewed source code and we have ensured  
> that there is no weird stuff going on during the link cycle.
>
> Anyway,  preserving code reviewed code is the primary purpose of my  
> refactor tool...

That makes sense. Clang AST + Indexer library were meant to support  
this kind of transformation; I hope it's working out for you.

> I will be making a beta available to the group in a couple of weeks  
> with a cute wxwidgets front end.

Cool.

> ...but someone will need to go through and add this information for  
> us to maintain all type source information for expressions and  
> statements.
>
>     - Doug
>
> That will probably be me... :)

Great!

	- Doug




More information about the cfe-dev mailing list