diff gcc/sbitmap.c @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children 04ced10e8804
line wrap: on
line diff
--- a/gcc/sbitmap.c	Tue May 25 18:58:51 2010 +0900
+++ b/gcc/sbitmap.c	Tue Mar 22 17:18:12 2011 +0900
@@ -1,5 +1,5 @@
 /* Simple bitmaps.
-   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2006, 2007, 2008
+   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2006, 2007, 2008, 2010
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -21,27 +21,33 @@
 #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 "sbitmap.h"
+
+#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"
-#include "sbitmap.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
+#  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 @@
 }
 
 #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.  */
 
@@ -997,7 +1011,7 @@
   fprintf (file, "}\n");
 }
 
-void
+DEBUG_FUNCTION void
 debug_sbitmap (const_sbitmap bmap)
 {
   dump_sbitmap_file (stderr, bmap);