This is the mail archive of the
mailing list for the GCC project.
Re: [patch] flatten/adjust optabs.h
- From: Jeff Law <law at redhat dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Michael Collison <michael dot collison at linaro dot org>
- Date: Fri, 31 Oct 2014 11:21:48 -0600
- Subject: Re: [patch] flatten/adjust optabs.h
- Authentication-results: sourceware.org; auth=none
- References: <54525C7F dot 8060907 at redhat dot com>
On 10/30/14 09:42, Andrew MacLeod wrote:
OK. No strong feelings on the insn-opinit issue and it'd be easy to
change it if we want to do something different.
This patch "adjusts" optabs.h. which was really sub-work of looking at
I moved the prototypes from expr.h to optabs.h that belong there, and
realigned the stuff in optabs.h to be in the same order as the .c file.
I also moved gen_move_insn from optabs.c to expr.c... a number of new
files would have required optabs.h to compile just for that funciton,
and gen_move_insn primarily calls emit-move_insn_1 which is defined in
expr.c anyway.. so it makes sense to be there.
the one thing Im on the fence about is insn-opinit.h. This is *only*
included from optabs.h, so I am inclined to leave it as an include from
optabs.h. We'd likely just be putting it back there later anyway.
I also moved the first section of optabs.h into genopinit.c... that
contains the parts which define structures, prototypes and a couple of
small inlines for things in insn-opinit.c.. so I figured we may as well
may insn-opinit.h follow the same pattern and list the exports and such
for insn-opinit.c. Now, ultimately I don't feel strongly about that
since insn-opinit.h is always included from optabs.h... if someone
objects I can move them back out of the generated file.
Other than that, its just more header adjustments.
bootstraps on x86_64-unknown-linux-gnu, testsuite regressions a re
running (I expect none again) and I'll ruin it through a full set of
targets from contrib/config-list.mk.
Assuming no issues, ok for trunk?
* optabs.h: Flatten insn-codes.h to source files. Move some prototypes
and structs to genopinit.c. Adjust protyoptypes to match optabs.c.
* genopinit.c (main): Emit prototypes and structs into insn-opinit.h.
* optabs.c: (gen_move_insn): Move to expr.c.
* expr.h: Move protypes and enums to optabs.h.
* expr.c: (gen_move_insn): Relocate from optabs.c.
* genemit.c (main): Include insn-codes.h.
* gengtype.c (open_base_files): Include insn-codes.h.
Maybe you've hit on a reasonable exception to the general rule of not
including other files in a .h file. I doubt we'd really know until
we're further along in this process.