]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
basic-block.h (OBSTACK_ALLOC_REG_SET): Adjust.
authorNathan Sidwell <nathan@codesourcery.com>
Thu, 25 Nov 2004 10:31:38 +0000 (10:31 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 25 Nov 2004 10:31:38 +0000 (10:31 +0000)
* basic-block.h (OBSTACK_ALLOC_REG_SET): Adjust.
(FREE_REG_SET): Adjust.
* bitmap.c (bitmap_obstack_free): Cope with NULL bitmap.
* bitmap.h (BITMAP_OBSTACK_ALLOC): Rename to ...
(BITMAP_ALLOC): ... here.
(BITMAP_OBSTACK_FREE): Rename to ...
(BITMAP_FREE): Don't check for NULL bitmap here.
* tree-ssa-pre.c (value_insert_into_set_bitmap,
bitmap_set_new): Use new names.

From-SVN: r91281

gcc/ChangeLog
gcc/basic-block.h
gcc/bitmap.c
gcc/bitmap.h
gcc/tree-ssa-pre.c

index b162c9b8019243e1b2922cd7453e21d0240e6378..59750285b58e3f75ae4538162450680494a1949a 100644 (file)
@@ -1,5 +1,15 @@
 2004-11-25  Nathan Sidwell  <nathan@codesourcery.com>
 
+       * basic-block.h (OBSTACK_ALLOC_REG_SET): Adjust.
+       (FREE_REG_SET): Adjust.
+       * bitmap.c (bitmap_obstack_free): Cope with NULL bitmap.
+       * bitmap.h (BITMAP_OBSTACK_ALLOC): Rename to ...
+       (BITMAP_ALLOC): ... here.
+       (BITMAP_OBSTACK_FREE): Rename to ...
+       (BITMAP_FREE): Don't check for NULL bitmap here.
+       * tree-ssa-pre.c (value_insert_into_set_bitmap,
+       bitmap_set_new): Use new names.
+
        * bt-load.c (migrate_btr_defs): Remove unneeded NULL check.
        * df.c (df_free): Likewise.
        * ra-build.c (ra_build_free, ra_build_free_all): Likewise.
index 277888b13e231e4c0182ed65e53257cc9a9cd166..0a3f2e08105b4474a96a9be5e8b197f4eb525795 100644 (file)
@@ -38,10 +38,10 @@ typedef bitmap_head regset_head;
 typedef bitmap regset;
 
 /* Allocate a register set with oballoc.  */
-#define ALLOC_REG_SET(OBSTACK) BITMAP_OBSTACK_ALLOC (OBSTACK)
+#define ALLOC_REG_SET(OBSTACK) BITMAP_ALLOC (OBSTACK)
 
 /* Do any cleanup needed on a regset when it is no longer used.  */
-#define FREE_REG_SET(REGSET) BITMAP_OBSTACK_FREE (REGSET)
+#define FREE_REG_SET(REGSET) BITMAP_FREE (REGSET)
 
 /* Initialize a new regset.  */
 #define INIT_REG_SET(HEAD) bitmap_initialize (HEAD, &reg_obstack)
index cbedf2c7b1adf688daa580207d0b94e7a59de75b..275e440d6c3220c05f7ef479396162ed81ea6782 100644 (file)
@@ -241,9 +241,12 @@ bitmap_malloc_alloc (void)
 void
 bitmap_obstack_free (bitmap map)
 {
-  bitmap_clear (map);
-  map->first = (void *)map->obstack->heads;
-  map->obstack->heads = map;
+  if (map)
+    {
+      bitmap_clear (map);
+      map->first = (void *)map->obstack->heads;
+      map->obstack->heads = map;
+    }
 }
 
 /* Release a malloc allocated bitmap.  */
index d6e316a3e89ce0de752bb8870b4661a02d5cf5e1..fb599cb275991d73a1ae5a6ba72b847edca3eb91 100644 (file)
@@ -156,7 +156,7 @@ extern void bitmap_malloc_free (bitmap);
 extern unsigned bitmap_first_set_bit (bitmap);
 
 /* Allocate a bitmap from a bit obstack.  */
-#define BITMAP_OBSTACK_ALLOC(OBSTACK) bitmap_obstack_alloc (OBSTACK)
+#define BITMAP_ALLOC(OBSTACK) bitmap_obstack_alloc (OBSTACK)
 
 /* Allocate a gc'd bitmap.  */
 #define BITMAP_GGC_ALLOC() bitmap_gc_alloc ()
@@ -165,14 +165,8 @@ extern unsigned bitmap_first_set_bit (bitmap);
 #define BITMAP_XMALLOC() bitmap_malloc_alloc ()
 
 /* Do any cleanup needed on a bitmap when it is no longer used.  */
-#define BITMAP_OBSTACK_FREE(BITMAP)                    \
-do {                                           \
-  if (BITMAP)                                  \
-    {                                          \
-      bitmap_obstack_free (BITMAP);            \
-      (BITMAP) = 0;                            \
-    }                                          \
-} while (0)
+#define BITMAP_FREE(BITMAP)                    \
+       ((void)(bitmap_obstack_free (BITMAP), (BITMAP) = NULL))
 
 /* Do any cleanup needed on an xmalloced bitmap when it is no longer used.  */
 #define BITMAP_XFREE(BITMAP)                   \
index 5bb552f6f81045456c9dfbcf5ad359e7eb7cdd0a..cbf43c42a70c5f88b21a22c3defdfb25cd008bac 100644 (file)
@@ -462,7 +462,7 @@ value_insert_into_set_bitmap (value_set_t set, tree v)
   gcc_assert (set->indexed);
 
   if (set->values == NULL)
-    set->values = BITMAP_OBSTACK_ALLOC (&grand_bitmap_obstack);
+    set->values = BITMAP_ALLOC (&grand_bitmap_obstack);
 
   bitmap_set_bit (set->values, VALUE_HANDLE_ID (v));
 }
@@ -474,8 +474,8 @@ static bitmap_set_t
 bitmap_set_new (void)
 {
   bitmap_set_t ret = pool_alloc (bitmap_set_pool);
-  ret->expressions = BITMAP_OBSTACK_ALLOC (&grand_bitmap_obstack);
-  ret->values = BITMAP_OBSTACK_ALLOC (&grand_bitmap_obstack);
+  ret->expressions = BITMAP_ALLOC (&grand_bitmap_obstack);
+  ret->values = BITMAP_ALLOC (&grand_bitmap_obstack);
   return ret;
 }