diff mbox

[1/4] Reduce alias.h dependencies

Message ID 558BFFDC.5070701@redhat.com
State New
Headers show

Commit Message

Andrew MacLeod June 25, 2015, 1:19 p.m. UTC
This patch moves the alias_set_type typedef from alias.h into coretypes.

Many common header files depend on the type, such as (but not limited to)
   gimple.h
   tree_ssa_alias.h
   rtl.h
   tree_core.h
   emit_rtl.h
   asan.h
   langhooks.h

A fully flattened branch requires alias.h in 294 source files in 
libbackend.a.  By moving that typedef into coretypes, the need for 
alias.h is reduced to just 27 files, all of which need the prototypes.

I removed alias.h from from a couple of header files which no longer 
need it.  I wont remove it from all the source files until I am slightly 
further along and do a mass reduction of includes.

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

Comments

Jeff Law June 25, 2015, 4:15 p.m. UTC | #1
On 06/25/2015 07:19 AM, Andrew MacLeod wrote:
> This patch moves the alias_set_type typedef from alias.h into coretypes.
>
> Many common header files depend on the type, such as (but not limited to)
>    gimple.h
>    tree_ssa_alias.h
>    rtl.h
>    tree_core.h
>    emit_rtl.h
>    asan.h
>    langhooks.h
>
> A fully flattened branch requires alias.h in 294 source files in
> libbackend.a.  By moving that typedef into coretypes, the need for
> alias.h is reduced to just 27 files, all of which need the prototypes.
>
> I removed alias.h from from a couple of header files which no longer
> need it.  I wont remove it from all the source files until I am slightly
> further along and do a mass reduction of includes.
>
> 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
>
>
> 1-alias.patch
>
>
> 	* alias.h (alias_set_type): Move typedef.
> 	* coretypes.h (alias_set_type): Relocate typedef here.
> 	* rtl.h: Don't include alias.h.
> 	* jit/jit-common.h: Likewise
OK.
jeff
diff mbox

Patch


	* alias.h (alias_set_type): Move typedef.
	* coretypes.h (alias_set_type): Relocate typedef here.
	* rtl.h: Don't include alias.h.
	* jit/jit-common.h: Likewise

Index: alias.h
===================================================================
*** alias.h	(revision 224602)
--- alias.h	(working copy)
*************** along with GCC; see the file COPYING3.
*** 20,33 ****
  #ifndef GCC_ALIAS_H
  #define GCC_ALIAS_H
  
- /* The type of an alias set.  Code currently assumes that variables of
-    this type can take the values 0 (the alias set which aliases
-    everything) and -1 (sometimes indicating that the alias set is
-    unknown, sometimes indicating a memory barrier) and -2 (indicating
-    that the alias set should be set to a unique value but has not been
-    set yet).  */
- typedef int alias_set_type;
- 
  extern alias_set_type new_alias_set (void);
  extern alias_set_type get_alias_set (tree);
  extern alias_set_type get_deref_alias_set (tree);
--- 20,25 ----
Index: coretypes.h
===================================================================
*** coretypes.h	(revision 224602)
--- coretypes.h	(working copy)
*************** enum var_init_status
*** 210,215 ****
--- 210,222 ----
    VAR_INIT_STATUS_INITIALIZED
  };
  
+ /* The type of an alias set.  Code currently assumes that variables of
+    this type can take the values 0 (the alias set which aliases
+    everything) and -1 (sometimes indicating that the alias set is
+    unknown, sometimes indicating a memory barrier) and -2 (indicating
+    that the alias set should be set to a unique value but has not been
+    set yet).  */
+ typedef int alias_set_type;
  
  struct edge_def;
  typedef struct edge_def *edge;
Index: rtl.h
===================================================================
*** rtl.h	(revision 224602)
--- rtl.h	(working copy)
*************** along with GCC; see the file COPYING3.
*** 38,44 ****
  #include "is-a.h"
  #endif  /* GENERATOR_FILE */
  
- #include "alias.h"
  #include "flags.h"
  
  /* Value used by some passes to "recognize" noop moves as valid
--- 38,43 ----
Index: jit/jit-common.h
===================================================================
*** jit/jit-common.h	(revision 224602)
--- jit/jit-common.h	(working copy)
*************** along with GCC; see the file COPYING3.
*** 24,30 ****
  #include "libgccjit.h"
  
  #include "vec.h"
- #include "alias.h"
  #include "flags.h"
  #include "symtab.h"
  #include "inchash.h"
--- 24,29 ----