I took a snapshot of trunk and completely flattened all the header files and tried removing them one by one. Then I looked at the dependencies between the files which prevented removal of certain headers and looked to see what could be simplified.

Initially I was looking at removing the need to include tm.h on headers that didn't seem like they should need it, but it turned out hard-reg-set.h was also a big offender.

The following 5 patches are the initial results of my experiment. Once these are approved/adjusted and I get them checked in, I will do the exercise again and look at building up some module headers... assuming the trimming seems reasonable..

There may be a bit more tweaking needed, especially since I'm not sure what he original intentions were for some of those files. It seems to me that after these patches, there is probably 3 major component headers to set up. tree, gimple and rtl.

tree.h and gimple.h are pretty obvious, but I was wondering about rtl.h. It is complicated by the fact that it is included by a lot of the generators in a very handcuffed way, and I'm not really going to try to untangle that.. its very target configured and I don't think it needs mucking with right now. Instead, I noticed that target.h looks like someone was trying to build that up as the main file to include when you needed to do something for a target, like generate rtl and target code.

So I'd propose that I'd look to see whats necessary for compilation, as well as the most heavily used auxiliary routines for 3 major components:
tree.h
gimple.h
target.h
and that source files be adjusted to include anywhere from the 1-3 of those that they need, and that they each bring in most the required files for the component... as indicated by an analysis of what is usually needed. Does that seem like a reasonable breakdown? what was the *real* intention of target.h?

I also plan to rebuild cgraph.h and df.h a bit so they don't bring in a lot of extra things and line up well, and possibly some other minor sub-headers... we'll see where things fall... Im just not quite there yet :-)

Andrew

Reply via email to