aboutsummaryrefslogtreecommitdiff
path: root/gcc/sbitmap.c
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2010-05-23 00:11:55 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2010-05-23 00:11:55 +0000
commit9ecb17301f36e6686c0c0a1cd3563a20a9a3d7ac (patch)
tree80716b09a5f6c1d08784c4b1727ced48d103ed33 /gcc/sbitmap.c
parent62a00d08999857afe805900d1892a4af09dead8a (diff)
downloadgcc-9ecb17301f36e6686c0c0a1cd3563a20a9a3d7ac.zip
gcc-9ecb17301f36e6686c0c0a1cd3563a20a9a3d7ac.tar.gz
gcc-9ecb17301f36e6686c0c0a1cd3563a20a9a3d7ac.tar.bz2
sbitmap.h (sbitmap_ptr, [...]): Move from here...
* 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. From-SVN: r159749
Diffstat (limited to 'gcc/sbitmap.c')
-rw-r--r--gcc/sbitmap.c42
1 files changed, 28 insertions, 14 deletions
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index 205b182..8ffc6f3 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. */