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: Factor unrelated declarations out of tree.h (2/2)


On 11/14/2013 05:16 PM, Joseph S. Myers wrote:
On Thu, 14 Nov 2013, Diego Novillo wrote:

This patch contains the mechanical side-effects from
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01663.html
There are rather a lot of "Include tm.h" changes here - especially in
front ends, where we've tried to eliminate tm.h calls, and put comments on
some of those remaining saying exactly what target macros are used to make
clear what's needed to eliminate them.  Putting in these includes, without
clear comments explaining how to eliminate them, seems a step backwards.
The problem is larger than that... function.h includes tm.h as well... and something like 140ish files include function.h, not to mention another 5 include files bring it in... basic-block.h, cfgloop.h, cgraph.h, expr.h, and gimple-streamer.h

so pretty much every file in existence gets tm.h one way or another :-P Aren't our includes spectacular?

I' ve been thinking that the only way to really tackle this is to flatten *everything* so that nothing but .c files have #includes, and then trim out all the includes that each .c requires, and then see where we sit. .h files bringing in other .h files really muck things up.

I was contemplating giving that a go over the weekend or maybe next week to see what it looks like... I have some scripts that flatten includes into the .c files and then try to trim out the ones which aren't needed from each .c file.

Andrew

btw, I ran tm.h through the include removal script for the c family front end files... The attached patch compiles on x64 and removes 37 includes from the front end files.... those are just the extraneous ones... but it may be helpful...
diff -cpN D2/c/c-convert.c c/c-convert.c
*** D2/c/c-convert.c	2013-11-14 21:20:19.045366205 -0500
--- c/c-convert.c	2013-11-14 21:34:12.118616282 -0500
*************** along with GCC; see the file COPYING3.  
*** 26,32 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "flags.h"
  #include "convert.h"
--- 26,31 ----
diff -cpN D2/c/c-lang.c c/c-lang.c
*** D2/c/c-lang.c	2013-11-14 21:20:19.046366178 -0500
--- c/c-lang.c	2013-11-14 21:34:12.120616352 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "fold-const.h"
  #include "c-tree.h"
--- 21,26 ----
diff -cpN D2/cp/call.c cp/call.c
*** D2/cp/call.c	2013-11-14 21:20:19.055366196 -0500
--- cp/call.c	2013-11-14 21:34:12.128616282 -0500
*************** along with GCC; see the file COPYING3.  
*** 25,31 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stor-layout.h"
  #include "trans-mem.h"
--- 25,30 ----
diff -cpN D2/cp/class.c cp/class.c
*** D2/cp/class.c	2013-11-14 21:20:19.056366297 -0500
--- cp/class.c	2013-11-14 21:34:12.129616280 -0500
*************** along with GCC; see the file COPYING3.  
*** 24,30 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "stor-layout.h"
--- 24,29 ----
diff -cpN D2/cp/cp-gimplify.c cp/cp-gimplify.c
*** D2/cp/cp-gimplify.c	2013-11-14 21:20:19.057366193 -0500
--- cp/cp-gimplify.c	2013-11-14 21:34:12.130616220 -0500
*************** along with GCC; see the file COPYING3.  
*** 22,28 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stor-layout.h"
  #include "cp-tree.h"
--- 22,27 ----
diff -cpN D2/cp/cp-lang.c cp/cp-lang.c
*** D2/cp/cp-lang.c	2013-11-14 21:20:19.057366193 -0500
--- cp/cp-lang.c	2013-11-14 21:34:12.130616220 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "cp-tree.h"
  #include "c-family/c-common.h"
--- 21,26 ----
diff -cpN D2/cp/cp-objcp-common.c cp/cp-objcp-common.c
*** D2/cp/cp-objcp-common.c	2013-11-14 21:20:19.057366193 -0500
--- cp/cp-objcp-common.c	2013-11-14 21:34:12.130616220 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "cp-tree.h"
  #include "c-family/c-common.h"
--- 21,26 ----
diff -cpN D2/cp/cvt.c cp/cvt.c
*** D2/cp/cvt.c	2013-11-14 21:20:19.058366239 -0500
--- cp/cvt.c	2013-11-14 21:34:12.132616292 -0500
*************** along with GCC; see the file COPYING3.  
*** 27,33 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stor-layout.h"
  #include "flags.h"
--- 27,32 ----
diff -cpN D2/cp/cxx-pretty-print.c cp/cxx-pretty-print.c
*** D2/cp/cxx-pretty-print.c	2013-11-14 21:20:19.059366182 -0500
--- cp/cxx-pretty-print.c	2013-11-14 21:34:12.132616292 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "intl.h"
  #include "cp-tree.h"
  #include "cxx-pretty-print.h"
--- 21,26 ----
diff -cpN D2/cp/decl2.c cp/decl2.c
*** D2/cp/decl2.c	2013-11-14 21:20:19.060366227 -0500
--- cp/decl2.c	2013-11-14 21:34:12.133616274 -0500
*************** along with GCC; see the file COPYING3.  
*** 29,35 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "varasm.h"
--- 29,34 ----
diff -cpN D2/cp/dump.c cp/dump.c
*** D2/cp/dump.c	2013-11-14 21:20:19.062366188 -0500
--- cp/dump.c	2013-11-14 21:34:12.135616224 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "cp-tree.h"
  #include "tree-dump.h"
--- 21,26 ----
diff -cpN D2/cp/error.c cp/error.c
*** D2/cp/error.c	2013-11-14 21:20:19.062366188 -0500
--- cp/error.c	2013-11-14 21:34:12.135616224 -0500
*************** along with GCC; see the file COPYING3.  
*** 20,26 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "cp-tree.h"
--- 20,25 ----
diff -cpN D2/cp/except.c cp/except.c
*** D2/cp/except.c	2013-11-14 21:20:19.062366188 -0500
--- cp/except.c	2013-11-14 21:34:12.135616224 -0500
*************** along with GCC; see the file COPYING3.  
*** 24,30 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "trans-mem.h"
--- 24,29 ----
diff -cpN D2/cp/expr.c cp/expr.c
*** D2/cp/expr.c	2013-11-14 21:20:19.062366188 -0500
--- cp/expr.c	2013-11-14 21:34:12.136622822 -0500
*************** along with GCC; see the file COPYING3.  
*** 22,28 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "flags.h"
  #include "cp-tree.h"
--- 22,27 ----
diff -cpN D2/cp/friend.c cp/friend.c
*** D2/cp/friend.c	2013-11-14 21:20:19.063366217 -0500
--- cp/friend.c	2013-11-14 21:34:12.136622822 -0500
*************** along with GCC; see the file COPYING3.  
*** 20,26 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "cp-tree.h"
  #include "flags.h"
--- 20,25 ----
diff -cpN D2/cp/init.c cp/init.c
*** D2/cp/init.c	2013-11-14 21:20:19.064366230 -0500
--- cp/init.c	2013-11-14 21:34:12.137616254 -0500
*************** along with GCC; see the file COPYING3.  
*** 23,29 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "varasm.h"
--- 23,28 ----
diff -cpN D2/cp/lex.c cp/lex.c
*** D2/cp/lex.c	2013-11-14 21:20:19.064366230 -0500
--- cp/lex.c	2013-11-14 21:34:12.137616254 -0500
*************** along with GCC; see the file COPYING3.  
*** 24,30 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "input.h"
  #include "tree.h"
  #include "stringpool.h"
--- 24,29 ----
diff -cpN D2/cp/method.c cp/method.c
*** D2/cp/method.c	2013-11-14 21:20:19.065372113 -0500
--- cp/method.c	2013-11-14 21:34:12.138616317 -0500
*************** along with GCC; see the file COPYING3.  
*** 24,30 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "varasm.h"
--- 24,29 ----
diff -cpN D2/cp/name-lookup.c cp/name-lookup.c
*** D2/cp/name-lookup.c	2013-11-14 21:20:19.066366145 -0500
--- cp/name-lookup.c	2013-11-14 21:34:12.139616218 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "flags.h"
  #include "tree.h"
  #include "stringpool.h"
--- 21,26 ----
diff -cpN D2/cp/optimize.c cp/optimize.c
*** D2/cp/optimize.c	2013-11-14 21:20:19.066366145 -0500
--- cp/optimize.c	2013-11-14 21:34:12.139616218 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "cp-tree.h"
--- 21,26 ----
diff -cpN D2/cp/parser.c cp/parser.c
*** D2/cp/parser.c	2013-11-14 21:20:19.069366200 -0500
--- cp/parser.c	2013-11-14 21:34:12.142616258 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "timevar.h"
  #include "cpplib.h"
  #include "tree.h"
--- 21,26 ----
diff -cpN D2/cp/pt.c cp/pt.c
*** D2/cp/pt.c	2013-11-14 21:20:19.070366995 -0500
--- cp/pt.c	2013-11-14 21:34:12.144617002 -0500
*************** along with GCC; see the file COPYING3.  
*** 27,33 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "varasm.h"
--- 27,32 ----
diff -cpN D2/cp/ptree.c cp/ptree.c
*** D2/cp/ptree.c	2013-11-14 21:20:19.071370764 -0500
--- cp/ptree.c	2013-11-14 21:34:12.144617002 -0500
*************** along with GCC; see the file COPYING3.  
*** 22,28 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "print-tree.h"
  #include "cp-tree.h"
--- 22,27 ----
diff -cpN D2/cp/repo.c cp/repo.c
*** D2/cp/repo.c	2013-11-14 21:20:19.071370764 -0500
--- cp/repo.c	2013-11-14 21:34:12.144617002 -0500
*************** along with GCC; see the file COPYING3.  
*** 27,33 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "cp-tree.h"
--- 27,32 ----
diff -cpN D2/cp/rtti.c cp/rtti.c
*** D2/cp/rtti.c	2013-11-14 21:20:19.071370764 -0500
--- cp/rtti.c	2013-11-14 21:34:12.144617002 -0500
*************** along with GCC; see the file COPYING3.  
*** 22,28 ****
  #include "system.h"
  #include "intl.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "stor-layout.h"
--- 22,27 ----
diff -cpN D2/cp/search.c cp/search.c
*** D2/cp/search.c	2013-11-14 21:20:19.071370764 -0500
--- cp/search.c	2013-11-14 21:34:12.144617002 -0500
*************** along with GCC; see the file COPYING3.  
*** 24,30 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "cp-tree.h"
  #include "intl.h"
--- 24,29 ----
diff -cpN D2/cp/tree.c cp/tree.c
*** D2/cp/tree.c	2013-11-14 21:20:19.072366774 -0500
--- cp/tree.c	2013-11-14 21:34:12.145628557 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stor-layout.h"
  #include "print-tree.h"
--- 21,26 ----
diff -cpN D2/cp/typeck2.c cp/typeck2.c
*** D2/cp/typeck2.c	2013-11-14 21:20:19.072366774 -0500
--- cp/typeck2.c	2013-11-14 21:34:12.146616872 -0500
*************** along with GCC; see the file COPYING3.  
*** 28,34 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stor-layout.h"
  #include "varasm.h"
--- 28,33 ----
diff -cpN D2/cp/typeck.c cp/typeck.c
*** D2/cp/typeck.c	2013-11-14 21:20:19.073366822 -0500
--- cp/typeck.c	2013-11-14 21:34:12.146616872 -0500
*************** along with GCC; see the file COPYING3.  
*** 27,33 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stor-layout.h"
  #include "varasm.h"
--- 27,32 ----
diff -cpN D2/c-family/c-ada-spec.c c-family/c-ada-spec.c
*** D2/c-family/c-ada-spec.c	2013-11-14 21:20:19.077428737 -0500
--- c-family/c-ada-spec.c	2013-11-14 21:34:12.150682418 -0500
*************** along with GCC; see the file COPYING3.  
*** 22,28 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "dumpfile.h"
  #include "c-ada-spec.h"
--- 22,27 ----
diff -cpN D2/c-family/c-dump.c c-family/c-dump.c
*** D2/c-family/c-dump.c	2013-11-14 21:20:19.079428741 -0500
--- c-family/c-dump.c	2013-11-14 21:34:12.153692387 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "tree-dump.h"
  #include "c-common.h"
--- 21,26 ----
diff -cpN D2/c-family/c-format.c c-family/c-format.c
*** D2/c-family/c-format.c	2013-11-14 21:20:19.080437538 -0500
--- c-family/c-format.c	2013-11-14 21:34:12.153692387 -0500
*************** along with GCC; see the file COPYING3.  
*** 20,26 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "flags.h"
--- 20,25 ----
diff -cpN D2/c-family/c-gimplify.c c-family/c-gimplify.c
*** D2/c-family/c-gimplify.c	2013-11-14 21:20:19.080437538 -0500
--- c-family/c-gimplify.c	2013-11-14 21:34:12.154693586 -0500
*************** along with GCC; see the file COPYING3.  
*** 26,32 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "c-common.h"
  #include "gimple.h"
--- 26,31 ----
diff -cpN D2/c-family/c-lex.c c-family/c-lex.c
*** D2/c-family/c-lex.c	2013-11-14 21:20:19.081446146 -0500
--- c-family/c-lex.c	2013-11-14 21:34:12.154693586 -0500
*************** along with GCC; see the file COPYING3.  
*** 20,26 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  
  #include "tree.h"
  #include "stringpool.h"
--- 20,25 ----
diff -cpN D2/c-family/c-pragma.c c-family/c-pragma.c
*** D2/c-family/c-pragma.c	2013-11-14 21:20:19.083428724 -0500
--- c-family/c-pragma.c	2013-11-14 21:34:12.156683983 -0500
*************** along with GCC; see the file COPYING3.  
*** 20,26 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stringpool.h"
  #include "attribs.h"
--- 20,25 ----
diff -cpN D2/c-family/c-pretty-print.c c-family/c-pretty-print.c
*** D2/c-family/c-pretty-print.c	2013-11-14 21:20:19.083428724 -0500
--- c-family/c-pretty-print.c	2013-11-14 21:34:12.156683983 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "stor-layout.h"
  #include "attribs.h"
--- 21,26 ----
diff -cpN D2/c-family/c-semantics.c c-family/c-semantics.c
*** D2/c-family/c-semantics.c	2013-11-14 21:20:19.084428734 -0500
--- c-family/c-semantics.c	2013-11-14 21:34:12.157678739 -0500
*************** along with GCC; see the file COPYING3.  
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "tm.h"
  #include "tree.h"
  #include "function.h"
  #include "splay-tree.h"
--- 21,26 ----

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