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]

[patch 7/8] Remove basic-block.h from cgraph.h


I also happened to notice that basic-block.h was being included directly by cgraph.h. The only thing cgraph.h and most of what use it need are the typedefs for gcov_type:

typedef HOST_WIDEST_INT gcov_type;
typedef unsigned HOST_WIDEST_INT gcov_type_unsigned;

This patch moves gcov_type and gcov_type_unsigned to coretypes.h.

I will note this is the first time HWINT is introduced to coretypes, but I believe system.h is suppose to always be included first, and that includes HWINT. we could also include HWINT from coretypes... But Im not sure what the standard practice for what goes into coretypes actually is.

In any case, by removing the basic-block.h include from cgraph.h, varasm.c was the only .c file that required a new include.

Does this seem reasonable?

bootstraps on x86_64-unknown-linux-gnu with no new regressions. OK?

Andrew


	* basic-block.h (gcov_type, gcov_type_unsigned): Move to coretypes.h.
	* coretypes.h (gcov_type, gcov_type_unsigned): Relocate here.
	* cgraph.h: Don't include basic-block.h.
	* varasm.c: Include basic-block.h.

*** T8/basic-block.h	2013-10-17 14:05:41.283303134 -0400
--- basic-block.h	2013-10-17 14:28:51.313383495 -0400
*************** along with GCC; see the file COPYING3.
*** 24,36 ****
  #include "vec.h"
  #include "function.h"
  
! /* Type we use to hold basic block counters.  Should be at least
     64bit.  Although a counter cannot be negative, we use a signed
     type, because erroneous negative counts can be generated when the
     flow graph is manipulated by various optimizations.  A signed type
     makes those easy to detect.  */
- typedef HOST_WIDEST_INT gcov_type;
- typedef unsigned HOST_WIDEST_INT gcov_type_unsigned;
  
  /* Control flow edge information.  */
  struct GTY((user)) edge_def {
--- 24,34 ----
  #include "vec.h"
  #include "function.h"
  
! /* Use gcov_type to hold basic block counters.  Should be at least
     64bit.  Although a counter cannot be negative, we use a signed
     type, because erroneous negative counts can be generated when the
     flow graph is manipulated by various optimizations.  A signed type
     makes those easy to detect.  */
  
  /* Control flow edge information.  */
  struct GTY((user)) edge_def {
*** T8/coretypes.h	2013-10-17 14:05:41.288303134 -0400
--- coretypes.h	2013-10-17 14:13:33.007307287 -0400
*************** see the files COPYING3 and COPYING.RUNTI
*** 43,48 ****
--- 43,51 ----
  
  #ifndef USED_FOR_TARGET
  
+ typedef HOST_WIDEST_INT gcov_type;
+ typedef unsigned HOST_WIDEST_INT gcov_type_unsigned;
+ 
  struct bitmap_head_def;
  typedef struct bitmap_head_def *bitmap;
  typedef const struct bitmap_head_def *const_bitmap;
*** T8/cgraph.h	2013-10-17 14:05:41.286303134 -0400
--- cgraph.h	2013-10-17 14:25:16.424376641 -0400
*************** along with GCC; see the file COPYING3.
*** 25,31 ****
  #include "plugin-api.h"
  #include "vec.h"
  #include "tree.h"
- #include "basic-block.h"
  #include "function.h"
  #include "ipa-ref.h"
  
--- 25,30 ----
*** T8/varasm.c	2013-10-17 14:05:41.335303131 -0400
--- varasm.c	2013-10-17 14:17:08.632339088 -0400
*************** along with GCC; see the file COPYING3.
*** 50,55 ****
--- 50,56 ----
  #include "cgraph.h"
  #include "pointer-set.h"
  #include "asan.h"
+ #include "basic-block.h"
  
  #ifdef XCOFF_DEBUGGING_INFO
  #include "xcoffout.h"		/* Needed for external data

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