On 07/15/2015 10:32 AM, Andrew MacLeod wrote:
I think this is the last patch before I start include reductions and
cleanups.

options.h is generated with the following snippet:

/* Anything that includes tm.h, does not necessarily need this.  */"
#if !defined(GCC_TM_H)
#include "input.h" /* for location_t */
<...>
// bunch of prototypes which use location_t
<...>
#endif

This is primarily so that the generator files can compile which don't
include input.h, and thus have no location_t defined.
options.h is usually included by tm.h, but some front end files include
just option.h, and the inclusion of input.h is so that they don't have
to I guess.

input.h is now included by coretypes.h, so any of these files that care
about the prototypes  already have input.h.  It seems to make more sense
to simply check if input.h has been included instead of a weird
contortion on tm.h, which is really unrelated in many ways. (I'm simply
checking if UNKNOWN_LOCATION is defined)   In fact, the current approach
introduces a latent ordering issue in a number of front end files...
they include options.h because they dont need tm.h, but then include
tm.h indirectly through target.h..  if the include order is changed such
that target.h was included *before* options.h (or instead of), some
files fail to compile because they no longer see these prototypes. this
just cleans that crud up.

The other 4 files in the patch include tm.h on a line with a multi-line
comment following it.  The comment is suppose to reflect what macros the
include is for, but at least some of these are out of date.. no one
updates them. The information they convey is easily determined in an up
to date way by simply removing the include from the list and compiling
the .o.  Plus many other front end files dont bother with this, so its
inconsistent.  And my real motivation is because it plays havoc with my
automatic include maniupulations :-)    So i propose just removing the
comments.

I didnt bother trying to merge options.h and tm.h in various files,
mostly because for the include reduction, Im going to flatten option.h
out of tm.h and tm.h/hard-reg-set.h  out of target.h.  I wont bother
submitting that to mainline since its going to affect all the same files
I'll be checking in later.  When the reduction is done, I'll look at who
actually needed options.h, tm.h, target.h and maybe they'll probably get
mashed back to the way they are now(or maybe they wont... :-)  it'll
depend on the usage patterns.  In any case, i dont need to pollute trunk
until I know for sure.

This bootstraps on x86_64-unknown-linux-gnu with no new regressions.  ok
for trunk?
OK.
jeff

Reply via email to