On 06/17/2015 08:28 AM, Richard Biener wrote:
On Tue, Jun 16, 2015 at 7:16 PM, Andrew MacLeod <amacl...@redhat.com> wrote:
Pretty much everything in the compiler has a need for both is-a.h and
input.h, so this patch moves those into coretypes.h (and rtl.h for
generators.. :-P still working on a good way around that)
is-a.h is required by anything which includes gimple.h, rtl.h or cgraph.h
currently, and I expect its use to grow if anything.
input.h includes line-map.h and provides location_t whose use is ubiquitous
throughout the compiler. tree-core.h, rtl.h, gimple.h, function.h all
require its definition for instance. There are some files where input.h is
included indirectly up to 7 times :-P
I think those are the last two which I'd currently propose go into
coretypes.h. This patch puts them there, and removes all the other places
in the compiler that include them directly, allowing them to come only from
coretypes.h. The patch is big, but almost all mechanical. the first 2
files in the patch are coretypes.h and rtl.h so you don't have to paw around
for them.
Bootstraps on x86_64-unknown-linux-gnu with no new regressions, and compiles
the targets in config-list.mk.
OK for trunk?
Index: hwint.c
===================================================================
*** hwint.c (revision 224345)
--- hwint.c (working copy)
*************** along with GCC; see the file COPYING3.
*** 19,24 ****
--- 19,25 ----
#include "config.h"
#include "system.h"
+ #include "input.h"
generally all files should instead include coretypes.h after system.h
Index: vec.c
===================================================================
*** vec.c (revision 224345)
--- vec.c (working copy)
*************** along with GCC; see the file COPYING3.
*** 29,36 ****
...
#include "system.h"
#include "coretypes.h"
#include "hash-table.h"
+ #include "input.h"
+ #include "diagnostic-core.h"
I'm sure input.h is not needed here.
Ah, both files fell into the same trap. Both included
diagnostic-core.h, and both were also used by generator files, so they
wouldn't get input.h from coretypes.h.
Turns out neither file actually requires diagnostic-core.h, so I can
remove that include from both files, and that removes the need for
input.h when they are generators...
so include coretypes.h in hwint.c, and remove both input.h and
diagnostic-core.h from vec.c.
Thanks
Andrew