On 07/07/2015 07:40 AM, Andrew MacLeod wrote:
This is a series of 9 patches which does some flattening, some module
building, and some basic cleanups.

  I am presenting them as 9 patches for easier review. The latter couple
of patches affect a lot of the same files that follow on patches then
adjust, I've decided NOT to put the automated changes in with each of
those patches.

There are 8 patches showing the key changes, and then the 9th patch is
an aggregate of the first 8 key changes, plus the final result of the
impact on all the source files.  This is the only patch I'd like to commit.

  The automated tools which generate the source changes have been
significantly enhanced.  When a header is flattened, the source file is
checked for the existence of the headers which need moving, and any
which are already present are left if they are in the right order. Any
duplicate are also removed.

  A similar process is used when an aggregation file like backend.h or
ssa.h is processed. Any occurrences of the aggregated headers are
removed from the source file so there are no duplicates.  The aggregated
headers are typically only placed in a source file if 3 or more of the
headers would be replaced.  (ie, if only bitmap.h is included, I don't
just blindly put backend.h in the file.)   This number came from
analysis of a fully flattened and include-reduced tree, and seemed to be
the sweet spot.

  With the aggregation and flattening, the order of some includes can
get shifted around with other files in between, so the tools also ensure
there is a "blessed" order which will make sure than any pre-reqs are
always available.  Right now, its primarily:

config.h
system.h
coretypes.h
backend.h
tree.h
gimple.h
rtl.h
df.h
ssa.h

And if any of the aggregators are not present, then any headers which
make up the aggregator are in the same relative position.

The tools actually produced all these patches with no tweaking to solve
compilation failures.. which was very helpful.  The old ones needed some
guidance and were a bit finicky.

I can adjust any of this quite easily, or present them in a different
way if you don't like it this way.  Again, my goal is to check in just
the final patch which does all the work of first 8 patches.    It would
be a lot less turmoil on the branch.   I can do it in smaller chunks if
need be.
The set of 9 patches is fine for the trunk.  Just a few discussion points...

One of the things I keep thinking about as these changes fly by is your scripts. Is there a reasonable possibility for you to add your scripts to the contrib/ directory or something similar to aid us in any future header file refactoring? Yes, I know that in theory we should never have to do this again, but I also know that reality can be rather different.

Presumably the aggregators, by policy, are to have #includes and nothing else, right? If so, we might want a comment to that effect in them.

It's a bit of a shame that function.h is in backend.h, along with predict (which is presumably needed by basic-block/cfg?).


Jeff

Reply via email to