diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-23 00:11:55 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-23 00:11:55 +0000 |
commit | 7ffb8e039b6ad0ca70279d7d387a423eccd26688 (patch) | |
tree | 80716b09a5f6c1d08784c4b1727ced48d103ed33 | |
parent | 2fcf418696253a0ea47afce9e3463107bb71b056 (diff) | |
download | gcc-7ffb8e039b6ad0ca70279d7d387a423eccd26688.tar.gz |
* sbitmap.h (sbitmap_ptr, const_sbitmap_ptr): Move from here...
* sbitmap.c: ...to here to internalize sbitmap element access.
Do not include tm.h, rtl.h, flags.h, hard-reg-set.h, and obstack.h.
Explain why basic-block.h is included.
* function.h: Include tm.h for CUMULATIVE_ARGS.
* Makefile.in: Update dependencies.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159749 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/Makefile.in | 5 | ||||
-rw-r--r-- | gcc/function.h | 1 | ||||
-rw-r--r-- | gcc/sbitmap.c | 42 | ||||
-rw-r--r-- | gcc/sbitmap.h | 3 |
5 files changed, 40 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a6d11a7a455..c1baa8e6ab7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2010-05-23 Steven Bosscher <steven@gcc.gnu.org> + + * sbitmap.h (sbitmap_ptr, const_sbitmap_ptr): Move from here... + * sbitmap.c: ...to here to internalize sbitmap element access. + Do not include tm.h, rtl.h, flags.h, hard-reg-set.h, and obstack.h. + Explain why basic-block.h is included. + * function.h: Include tm.h for CUMULATIVE_ARGS. + * Makefile.in: Update dependencies. + 2010-05-22 Steven Bosscher <steven@gcc.gnu.org> * coretypes.h (struct simple_bitmap_def, sbitmap, const_sbitmap): diff --git a/gcc/Makefile.in b/gcc/Makefile.in index e7998f42966..6899b5fa530 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -889,7 +889,7 @@ RECOG_H = recog.h ALIAS_H = alias.h coretypes.h EMIT_RTL_H = emit-rtl.h FLAGS_H = flags.h coretypes.h options.h -FUNCTION_H = function.h $(TREE_H) $(HASHTAB_H) vecprim.h +FUNCTION_H = function.h $(TREE_H) $(HASHTAB_H) vecprim.h $(TM_H) EXPR_H = expr.h insn-config.h $(FUNCTION_H) $(RTL_H) $(FLAGS_H) $(TREE_H) $(MACHMODE_H) $(EMIT_RTL_H) OPTABS_H = optabs.h insn-codes.h REGS_H = regs.h $(MACHMODE_H) $(OBSTACK_H) $(BASIC_BLOCK_H) $(FUNCTION_H) @@ -2013,8 +2013,7 @@ c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ graph.o: graph.c $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) $(FLAGS_H) output.h \ $(RTL_H) $(FUNCTION_H) hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(OBSTACK_H) \ $(CONFIG_H) -sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) +sbitmap.o: sbitmap.c sbitmap.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(BASIC_BLOCK_H) ebitmap.o: ebitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(EBITMAP_H) $(RTL_H) $(FLAGS_H) $(OBSTACK_H) sparseset.o: sparseset.c $(SYSTEM_H) sparseset.h $(CONFIG_H) diff --git a/gcc/function.h b/gcc/function.h index d008e8586ef..9063e52558c 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "hashtab.h" #include "vecprim.h" +#include "tm.h" /* For CUMULATIVE_ARGS. */ /* Stack of pending (incomplete) sequences saved by `start_sequence'. Each element describes one pending sequence. diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index 205b1827284..8ffc6f334b7 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -21,27 +21,33 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" #include "coretypes.h" -#include "tm.h" -#include "rtl.h" -#include "flags.h" -#include "hard-reg-set.h" -#include "obstack.h" -#include "basic-block.h" #include "sbitmap.h" -#if GCC_VERSION >= 3400 -#if HOST_BITS_PER_WIDEST_FAST_INT == HOST_BITS_PER_LONG -#define do_popcount(x) __builtin_popcountl(x) -#elif HOST_BITS_PER_WIDEST_FAST_INT == HOST_BITS_PER_LONGLONG -#define do_popcount(x) __builtin_popcountll(x) -#else -#error "internal error: sbitmap.h and hwint.h are inconsistent" +#ifdef IN_GCC +/* FIXME: sbitmap is just a data structure, but we define dataflow functions + here also. This is conditional on IN_GCC (see second #ifdef IN_GCC + further down). + For now, also only conditionally include basic-block.h, but we should + find a better place for the dataflow functions. Perhaps cfganal.c? */ +#include "basic-block.h" #endif + +#if GCC_VERSION >= 3400 +# if HOST_BITS_PER_WIDEST_FAST_INT == HOST_BITS_PER_LONG +# define do_popcount(x) __builtin_popcountl(x) +# elif HOST_BITS_PER_WIDEST_FAST_INT == HOST_BITS_PER_LONGLONG +# define do_popcount(x) __builtin_popcountll(x) +# else +# error "internal error: sbitmap.h and hwint.h are inconsistent" +# endif #else static unsigned long sbitmap_elt_popcount (SBITMAP_ELT_TYPE); -#define do_popcount(x) sbitmap_elt_popcount((x)) +# define do_popcount(x) sbitmap_elt_popcount((x)) #endif +typedef SBITMAP_ELT_TYPE *sbitmap_ptr; +typedef const SBITMAP_ELT_TYPE *const_sbitmap_ptr; + /* This macro controls debugging that is as expensive as the operations it verifies. */ @@ -739,6 +745,14 @@ sbitmap_a_and_b_or_c (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitm } #ifdef IN_GCC +/* FIXME: depends on basic-block.h, see comment at start of this file. + + Ironically, the comments before the functions below suggest they do + dataflow using the "new flow graph structures", but that's the *old* + new data structures. The functions receive basic block numbers and + use BASIC_BLOCK(idx) to get the basic block. They should receive + the basic block directly, *sigh*. */ + /* Set the bitmap DST to the intersection of SRC of successors of block number BB, using the new flow graph structures. */ diff --git a/gcc/sbitmap.h b/gcc/sbitmap.h index dc6d6715499..2e2c6245b1c 100644 --- a/gcc/sbitmap.h +++ b/gcc/sbitmap.h @@ -44,9 +44,6 @@ struct simple_bitmap_def SBITMAP_ELT_TYPE elms[1]; /* The elements. */ }; -typedef SBITMAP_ELT_TYPE *sbitmap_ptr; -typedef const SBITMAP_ELT_TYPE *const_sbitmap_ptr; - /* Return the set size needed for N elements. */ #define SBITMAP_SET_SIZE(N) (((N) + SBITMAP_ELT_BITS - 1) / SBITMAP_ELT_BITS) #define SBITMAP_SIZE_BYTES(BITMAP) ((BITMAP)->size * sizeof (SBITMAP_ELT_TYPE)) |