Identifying unnecessary #includes

Niko Sams niko.sams at gmail.com
Sat Mar 27 21:00:35 UTC 2010


On Sat, Mar 27, 2010 at 20:06, Casey Link <unnamedrambler at gmail.com> wrote:
> Hey KDev Devs,
>
> Amarok is working on re-organizing our code base, such that is is
> compartmentalized into libraries with few inter library dependencies.
> Over the years our source files have gathered many  #includes that are
> cruft. Aside from manually going through hundreds of files and testing
> via trial and error, we are looking for a way to identify and remove
> unnecessary #includes.
>
> We figured KDev4 and its DU chains might be able to help us. Could
> someone comment on this please?
The needed information is avaliable in DUChain, it's just a matter of using it.
The easiest way would be to write a plugin that does the #include-cleanup for
the currently open file - that way you can easily review the changes.
Or would you prefer to execute this action for all files at once?

Niko




More information about the KDevelop-devel mailing list