[patch] Flatten tree-ssa.h

Richard Biener richard.guenther@gmail.com
Wed Oct 23 10:04:00 GMT 2013


On Wed, Oct 23, 2013 at 5:21 AM, Andrew MacLeod <amacleod@redhat.com> wrote:
> When moving all the prototypes out of  tree-flow.h and into individual
> files, the "kitchen sink" #include list temporarily propagated it way into
> the new tree-ssa.h file.  tree-ssa.h is now in a position to contain only
> it's own prototypes.
>
> Its include list was:
> #include "bitmap.h"
> #include "gimple.h"
> #include "gimple-ssa.h"
> #include "cgraph.h"
> #include "tree-cfg.h"
> #include "tree-phinodes.h"
> #include "ssa-iterators.h"
> #include "tree-ssanames.h"
> #include "tree-ssa-loop.h"
> #include "tree-into-ssa.h"
> #include "tree-dfa.h"
>
> This patch flattens tree-ssa.h so that it no longer includes *any* of those
> include files.  The process, mostly automated:
> 1 - takes all the #include's from tree-ssa.h and copies them immediately
> before #include "tree-ssa.h" in every .c file which includes it.
> 2 - Remove each of those include files (as well as tree-ssa.h) one at a time
> from the .c file (bottom up)  and tries to compile it.
> 3 - Removes any which cause no compilation failures.
>
> This way each .c file gets only the includes it actually needed from
> tree-ssa.h, and often doesn't even require tree-ssa.h itself.  I haven't
> touched any existing includes unless they formed a duplicate of those copied
> from tree-ssa.h. (and that happens)
>
> This touches 147 files (!!!)  which included tree-ssa.h.... only 40 still
> need tree-ssa.h.
> tree-ssa.h had 11 include files and the average .c file ended up requiring
> only 3.
>
> bootstraps on  x86_64-unknown-linux-gnu with no new regressions. OK?

Ok.

Thanks,
Richard.

> Andrew
>



More information about the Gcc-patches mailing list