This is the mail archive of the gcc-patches@gcc.gnu.org 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 4/4] Remove options.h/tm.h and function.h as dependencies and include compile time prerequisites in cgraph.h


On 06/25/2015 07:27 AM, Andrew MacLeod wrote:

ipa_opt_pass is given a forward declaration in function.h, but it really
consumed by cgraph.h   By moving that forward declaration to cgraph, it
no longer requires function.h to be in the include path.   It actually
defined in tree-pass.h, the the *right* thing would be to require
tree-pass.h, but that seems unnecessary. Another option would be to do
the forward declaration in coretypes.h.. maybe that would be better?
It doesn't feel to me like ipa_opt_pass belongs in coretypes.h. I'd really prefer to not need ipa_opt_pass in cgraph.h, but as an interm step this seems fine.


The final thing I did was include ipa-ref.h and plugin-api.h from
cgraph.h.  There are hard requirements for compiling cgraph.h, and are
needed almost no where else, This is the first consolidation step.  Its
the right place to include them as indicated by the second part of the
patch which removes these 2 includes from all the source files in the
compiler, allowing them to just come from cgraph.h

Bootstraps on x86_64-unknown-linux-gnu with no new regressions. Also
builds stage 1 on all the targets in config-list.mk.

OK for trunk?

Andrew


4-cgraph.patch


	* function.h (ipa_opt_pass, ipa_opt_pass_d): Move forward declarations.
	* cgraph.h: Include ipa-ref.h and plugin-api.h.
	(ipa_opt_pass, ipa_opt_pass_d)): Relocate forward declarations here.
	(symtab_node::address_can_be_compared_p): Move function.
	* cgraph.c (symtab_node::address_can_be_compared_p): Relocate function
	definition here.
OK.
jeff


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