This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] flatten/adjust optabs.h

On 10/30/14 09:42, Andrew MacLeod wrote:
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/
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.
OK. No strong feelings on the insn-opinit issue and it'd be easy to change it if we want to do something different.

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]