diff mbox

Flatten flags.h

Message ID 559DAE45.9030502@redhat.com
State New
Headers show

Commit Message

Andrew MacLeod July 8, 2015, 11:12 p.m. UTC
While looking the initial results of an include reduction, there were a 
couple of problematic files that are relatively easy to resolve.

This patch addresses flags.h.  It includes both options.h and flag-types.h.

options.h already includes flag-types.h so including both is kind of 
silly :-).
flags.h appears in 421 files...  Only 25 of those files don't already 
include one of options.h,  backend.h, or tm.h (which also includes 
options.h). Those are the only files which needed addressing.

This patch removes the 2 includes, and makes adjustments to the other 25 
files..  either removing the include completely if not needed, replacing 
it with options.h if possible, and as a last resort adding options.h to 
the source file just before flags.h. In the end, only 2 actually 
required flags.h itself.

Bootstraps on x86_64-unknown-linux-gnu, and regressions are currently 
running.  Also successfully built the 2 epiphany targets as there was a 
config file touched for that target.

Assuming the regression run is clean, OK for trunk?

Andrew

Comments

Jeff Law July 9, 2015, 2:17 a.m. UTC | #1
On 07/08/2015 05:12 PM, Andrew MacLeod wrote:
> While looking the initial results of an include reduction, there were a
> couple of problematic files that are relatively easy to resolve.
>
> This patch addresses flags.h.  It includes both options.h and flag-types.h.
>
> options.h already includes flag-types.h so including both is kind of
> silly :-).
> flags.h appears in 421 files...  Only 25 of those files don't already
> include one of options.h,  backend.h, or tm.h (which also includes
> options.h). Those are the only files which needed addressing.
>
> This patch removes the 2 includes, and makes adjustments to the other 25
> files..  either removing the include completely if not needed, replacing
> it with options.h if possible, and as a last resort adding options.h to
> the source file just before flags.h. In the end, only 2 actually
> required flags.h itself.
>
> Bootstraps on x86_64-unknown-linux-gnu, and regressions are currently
> running.  Also successfully built the 2 epiphany targets as there was a
> config file touched for that target.
>
> Assuming the regression run is clean, OK for trunk?
OK.
jeff
diff mbox

Patch


	* flags.h: Don't include flag-types.h or options.h.
	* opts-common.c: Adjust includes.
	* opts-global.c: Likewise.
	* common/config/epiphany/epiphany-common.c: Likewise.

	* c/c-array-notation.c: Adjust includes.
	* c/c-objc-common.c: Likewise.

	* c-family/c-common.h: Adjust includes.
	* c-family/stub-objc.c: Likewise.
	
	* fortran/arith.c: Adjust includes.
	* fortran/array.c: Likewise.
	* fortran/check.c: Likewise.
	* fortran/decl.c: Likewise.
	* fortran/error.c: Likewise.
	* fortran/expr.c: Likewise.
	* fortran/frontend-passes.c: Likewise.
	* fortran/interface.c: Likewise.
	* fortran/intrinsic.c: Likewise.
	* fortran/io.c: Likewise.
	* fortran/match.c: Likewise.
	* fortran/openmp.c: Likewise.
	* fortran/parse.c: Likewise.
	* fortran/primary.c: Likewise.
	* fortran/resolve.c: Likewise.
	* fortran/scanner.c: Likewise.
	* fortran/simplify.c: Likewise.
	* fortran/symbol.c: Likewise.
	* fortran/target-memory.c: Likewise.

	* jit/dummy-frontend.c: Adjust includes.
	* jit/jit-common.h: Likewise.
	* jit/jit-playback.c: Likewise.

	* lto/lto-lang.c: Adjust includes.

Index: flags.h
===================================================================
*** flags.h	(revision 225530)
--- flags.h	(working copy)
*************** along with GCC; see the file COPYING3.
*** 20,28 ****
  #ifndef GCC_FLAGS_H
  #define GCC_FLAGS_H
  
- #include "flag-types.h"
- #include "options.h"
- 
  #if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
  
  /* Names of debug_info_type, for error messages.  */
--- 20,25 ----
Index: opts-common.c
===================================================================
*** opts-common.c	(revision 225530)
--- opts-common.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 22,28 ****
  #include "intl.h"
  #include "coretypes.h"
  #include "opts.h"
! #include "flags.h"
  #include "diagnostic.h"
  
  static void prune_options (struct cl_decoded_option **, unsigned int *);
--- 22,28 ----
  #include "intl.h"
  #include "coretypes.h"
  #include "opts.h"
! #include "options.h"
  #include "diagnostic.h"
  
  static void prune_options (struct cl_decoded_option **, unsigned int *);
Index: opts-global.c
===================================================================
*** opts-global.c	(revision 225531)
--- opts-global.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 23,28 ****
--- 23,29 ----
  #include "coretypes.h"
  #include "diagnostic.h"
  #include "opts.h"
+ #include "options.h"
  #include "flags.h"
  #include "alias.h"
  #include "backend.h"
Index: common/config/epiphany/epiphany-common.c
===================================================================
*** common/config/epiphany/epiphany-common.c	(revision 225530)
--- common/config/epiphany/epiphany-common.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 23,29 ****
  #include "coretypes.h"
  #include "common/common-target.h"
  #include "opts.h"
! #include "flags.h"
  
  #define TARGET_OPTION_OPTIMIZATION_TABLE epiphany_option_optimization_table
  
--- 23,29 ----
  #include "coretypes.h"
  #include "common/common-target.h"
  #include "opts.h"
! #include "options.h"
  
  #define TARGET_OPTION_OPTIMIZATION_TABLE epiphany_option_optimization_table
  
Index: c/c-array-notation.c
===================================================================
*** c/c-array-notation.c	(revision 225531)
--- c/c-array-notation.c	(working copy)
***************
*** 70,76 ****
  #include "coretypes.h"
  #include "tree.h"
  #include "alias.h"
- #include "flags.h"
  #include "c-tree.h"
  #include "gimple-expr.h"
  #include "tree-iterator.h"
--- 70,75 ----
Index: c/c-objc-common.c
===================================================================
*** c/c-objc-common.c	(revision 225531)
--- c/c-objc-common.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 22,28 ****
  #include "coretypes.h"
  #include "tree.h"
  #include "alias.h"
- #include "flags.h"
  #include "c-tree.h"
  #include "intl.h"
  #include "c-family/c-pretty-print.h"
--- 22,27 ----
Index: c-family/c-common.h
===================================================================
*** c-family/c-common.h	(revision 225531)
--- c-family/c-common.h	(working copy)
*************** along with GCC; see the file COPYING3.
*** 23,29 ****
  #include "splay-tree.h"
  #include "cpplib.h"
  #include "alias.h"
- #include "flags.h"
  #include "tree.h"
  #include "fold-const.h"
  
--- 23,28 ----
Index: c-family/stub-objc.c
===================================================================
*** c-family/stub-objc.c	(revision 225531)
--- c-family/stub-objc.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 24,30 ****
  #include "coretypes.h"
  #include "alias.h"
  #include "tree.h"
- #include "flags.h"
  #include "c-common.h"
  #include "c-objc.h"
  
--- 24,29 ----
Index: fortran/arith.c
===================================================================
*** fortran/arith.c	(revision 225530)
--- fortran/arith.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 26,32 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  #include "arith.h"
  #include "target-memory.h"
--- 26,32 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  #include "arith.h"
  #include "target-memory.h"
Index: fortran/array.c
===================================================================
*** fortran/array.c	(revision 225530)
--- fortran/array.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 21,26 ****
--- 21,27 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
+ #include "options.h"
  #include "flags.h"
  #include "gfortran.h"
  #include "match.h"
Index: fortran/check.c
===================================================================
*** fortran/check.c	(revision 225530)
--- fortran/check.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 28,34 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  #include "intrinsic.h"
  #include "constructor.h"
--- 28,34 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  #include "intrinsic.h"
  #include "constructor.h"
Index: fortran/decl.c
===================================================================
*** fortran/decl.c	(revision 225531)
--- fortran/decl.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 24,30 ****
  #include "gfortran.h"
  #include "match.h"
  #include "parse.h"
! #include "flags.h"
  #include "constructor.h"
  #include "alias.h"
  #include "tree.h"
--- 24,30 ----
  #include "gfortran.h"
  #include "match.h"
  #include "parse.h"
! #include "options.h"
  #include "constructor.h"
  #include "alias.h"
  #include "tree.h"
Index: fortran/error.c
===================================================================
*** fortran/error.c	(revision 225530)
--- fortran/error.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 27,33 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  
  #include "diagnostic.h"
--- 27,33 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  
  #include "diagnostic.h"
Index: fortran/expr.c
===================================================================
*** fortran/expr.c	(revision 225530)
--- fortran/expr.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  #include "arith.h"
  #include "match.h"
--- 21,27 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  #include "arith.h"
  #include "match.h"
Index: fortran/frontend-passes.c
===================================================================
*** fortran/frontend-passes.c	(revision 225530)
--- fortran/frontend-passes.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 23,29 ****
  #include "coretypes.h"
  #include "gfortran.h"
  #include "arith.h"
! #include "flags.h"
  #include "dependency.h"
  #include "constructor.h"
  #include "opts.h"
--- 23,29 ----
  #include "coretypes.h"
  #include "gfortran.h"
  #include "arith.h"
! #include "options.h"
  #include "dependency.h"
  #include "constructor.h"
  #include "opts.h"
Index: fortran/interface.c
===================================================================
*** fortran/interface.c	(revision 225530)
--- fortran/interface.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 66,72 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  #include "match.h"
  #include "arith.h"
--- 66,72 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  #include "match.h"
  #include "arith.h"
Index: fortran/intrinsic.c
===================================================================
*** fortran/intrinsic.c	(revision 225530)
--- fortran/intrinsic.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 22,28 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  #include "intrinsic.h"
  
--- 22,28 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  #include "intrinsic.h"
  
Index: fortran/io.c
===================================================================
*** fortran/io.c	(revision 225530)
--- fortran/io.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  #include "match.h"
  #include "parse.h"
--- 21,27 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  #include "match.h"
  #include "parse.h"
Index: fortran/match.c
===================================================================
*** fortran/match.c	(revision 225531)
--- fortran/match.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 21,26 ****
--- 21,27 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
+ #include "options.h"
  #include "flags.h"
  #include "gfortran.h"
  #include "match.h"
Index: fortran/openmp.c
===================================================================
*** fortran/openmp.c	(revision 225530)
--- fortran/openmp.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "flags.h"
  #include "gfortran.h"
  #include "arith.h"
  #include "match.h"
--- 21,26 ----
Index: fortran/parse.c
===================================================================
*** fortran/parse.c	(revision 225530)
--- fortran/parse.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 22,28 ****
  #include "system.h"
  #include <setjmp.h>
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  #include "match.h"
  #include "parse.h"
--- 22,28 ----
  #include "system.h"
  #include <setjmp.h>
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  #include "match.h"
  #include "parse.h"
Index: fortran/primary.c
===================================================================
*** fortran/primary.c	(revision 225530)
--- fortran/primary.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  #include "arith.h"
  #include "match.h"
--- 21,27 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  #include "arith.h"
  #include "match.h"
Index: fortran/resolve.c
===================================================================
*** fortran/resolve.c	(revision 225530)
--- fortran/resolve.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  #include "obstack.h"
  #include "bitmap.h"
--- 21,27 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  #include "obstack.h"
  #include "bitmap.h"
Index: fortran/scanner.c
===================================================================
*** fortran/scanner.c	(revision 225530)
--- fortran/scanner.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 46,52 ****
  #include "gfortran.h"
  #include "toplev.h"	/* For set_src_pwd.  */
  #include "debug.h"
! #include "flags.h"
  #include "cpp.h"
  #include "scanner.h"
  
--- 46,52 ----
  #include "gfortran.h"
  #include "toplev.h"	/* For set_src_pwd.  */
  #include "debug.h"
! #include "options.h"
  #include "cpp.h"
  #include "scanner.h"
  
Index: fortran/simplify.c
===================================================================
*** fortran/simplify.c	(revision 225530)
--- fortran/simplify.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "flags.h"
  #include "gfortran.h"
  #include "arith.h"
  #include "intrinsic.h"
--- 21,26 ----
Index: fortran/symbol.c
===================================================================
*** fortran/symbol.c	(revision 225530)
--- fortran/symbol.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 22,28 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "flags.h"
  #include "gfortran.h"
  #include "parse.h"
  #include "match.h"
--- 22,28 ----
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
! #include "options.h"
  #include "gfortran.h"
  #include "parse.h"
  #include "match.h"
Index: fortran/target-memory.c
===================================================================
*** fortran/target-memory.c	(revision 225531)
--- fortran/target-memory.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "flags.h"
  #include "alias.h"
  #include "tree.h"
  #include "fold-const.h"
--- 21,26 ----
Index: jit/dummy-frontend.c
===================================================================
*** jit/dummy-frontend.c	(revision 225531)
--- jit/dummy-frontend.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 22,28 ****
  #include "coretypes.h"
  #include "opts.h"
  #include "alias.h"
- #include "flags.h"
  #include "tree.h"
  #include "stor-layout.h"
  #include "inchash.h"
--- 22,27 ----
Index: jit/jit-common.h
===================================================================
*** jit/jit-common.h	(revision 225531)
--- jit/jit-common.h	(working copy)
*************** along with GCC; see the file COPYING3.
*** 24,30 ****
  #include "libgccjit.h"
  
  #include "vec.h"
- #include "flags.h"
  #include "tree.h"
  #include "inchash.h"
  #include "tree-iterator.h"
--- 24,29 ----
Index: jit/jit-playback.c
===================================================================
*** jit/jit-playback.c	(revision 225531)
--- jit/jit-playback.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 26,32 ****
  #include "statistics.h"
  #include "vec.h"
  #include "alias.h"
- #include "flags.h"
  #include "tree.h"
  #include "inchash.h"
  #include "hash-map.h"
--- 26,31 ----
Index: lto/lto-lang.c
===================================================================
*** lto/lto-lang.c	(revision 225531)
--- lto/lto-lang.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 21,27 ****
  #include "config.h"
  #include "system.h"
  #include "coretypes.h"
- #include "flags.h"
  #include "tm.h"
  #include "function.h"
  #include "predict.h"
--- 21,26 ----