[patch 4/4] Remove options.h/tm.h and function.h as dependencies and include compile time prerequisites in cgraph.h

Andrew MacLeod amacleod@redhat.com
Thu Jun 25 13:31:00 GMT 2015


This patch removes a couple more dependencies cgraph.h has.

The function address_can_be_compared_p makes reference to 
flag_merge_constants which comes from options.h via tm.h. By moving it 
to cgraph.c instead of inlining it in the header file, options.h and 
thus tm.h is no longer needed.

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?

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4-cgraph.patch
Type: text/x-patch
Size: 3894 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150625/b7174812/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4-rest.patch.Z
Type: application/x-compress
Size: 15153 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150625/b7174812/attachment-0001.bin>


More information about the Gcc-patches mailing list