[patch 4/5] Remove cgraph.h dependence on hard-reg-set.h

Andrew MacLeod amacleod@redhat.com
Tue Jun 16 17:20:00 GMT 2015


cgraph.h requires hard-reg-set.h in order to compile simply because the 
cgraph_rtl_info structure contains a HARD_REG_SET element.

All accesses to this structure are already handled by returning a 
pointer to the structure within the cgraph_node.  By moving the 
defintion of struct cgraph_rtl_info into rtl.h and maintaining a pointer 
to it instead of the structure within cgraph_node,  the compilation 
requirement on hard-reg-set.h can be completely removed when including 
cgraph.h.  This will hopefully help prevent bringing hard-reg-set and 
tm.h into a number of source files.

  The structure in rtl.h is protected by  checking for HARD_CONST (which 
many other things in rtl.h do). This is mostly so generator files won't 
trip over them.  2 source files needed adjustment because they didn't 
include hard-reg-set.h before rtl.h.  I guess they never referenced the 
other things protected by HARD_CONST in the file.  This ordering issue 
should shortly be resolved by an include grouping.

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

OK for trunk?

Andrew

PS shortly I plan to do some module header bundling and include 
reductions. At that point I'll remove unneeded includes of 
hard-reg-set.h from files


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cgraph.patch
Type: text/x-patch
Size: 5500 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150616/81000b74/attachment.bin>


More information about the Gcc-patches mailing list