[patch 2/5] Remove tree.h compilation dependency for tm.h

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


There are 2 macros defined in tree.h the depend on the definition of 
NO_DOT_IN_LABEL and NO_DOLLAR_IN_LABEL.   These are ANON_AGGRNAME_FORMAT 
and ANON_AGGRNAME_P.  This means that in order to get the correct values 
for those macros, you have to be sure that tm.h was included before 
tree.h, and thats the only conditional dependency tree.h has on tm.h.

By changing those 2 macos to functions and defining them in tree.c, the 
restriction/requirement is removed.  These are not heavily used, Im sure 
compilation issues are unmeasurable.

There is also single hard compilation dependency on the definition of 
TARGET_DLLIMPORT_DECL_ATTRIBUTES. it shows:

#if TARGET_DLLIMPORT_DECL_ATTRIBUTES
/* Given two Windows decl attributes lists, possibly including
    dllimport, return a list of their union .  */
extern tree merge_dllimport_decl_attributes (tree, tree);

/* Handle a "dllimport" or "dllexport" attribute.  */
extern tree handle_dll_attribute (tree *, tree, tree, int, bool *);
#endif


defaults.h provides a default definition of 0, but I'm not convinced 
that we need to hide function prototypes like this...  Anything that 
cares will be checking that macro before calling or creating those 
functions...  and if they don't there will be an unresolved external at 
compilation time.. so we still get an error.  We also don't get any 
errors if the prototype isn't used.  If it is not protected, then it 
removes the need to have defaults.h and tm.h included before tree.h

This patch makes both these changes, and tree.h no longer requires tm.h 
or defaults.h

bootstraps on x86_64-unknown-linux-gnu with no new regressions.  No 
failures on config-list.mk target runs either.

OK for trunk?
Andrew


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


More information about the Gcc-patches mailing list