diff options
author | Lawrence Crowl <crowl@google.com> | 2012-11-01 22:39:26 +0000 |
---|---|---|
committer | Lawrence Crowl <crowl@gcc.gnu.org> | 2012-11-01 22:39:26 +0000 |
commit | 5fd39ce63cb4ce431fbb4c668ad14e1c2335e76a (patch) | |
tree | 721953d1607e06b4dcb3e4e0e522f8d20d151d17 /gcc/ebitmap.h | |
parent | c291b2adc6f25d897928c79f431d987eb74e4bc5 (diff) | |
download | gcc-5fd39ce63cb4ce431fbb4c668ad14e1c2335e76a.zip gcc-5fd39ce63cb4ce431fbb4c668ad14e1c2335e76a.tar.gz gcc-5fd39ce63cb4ce431fbb4c668ad14e1c2335e76a.tar.bz2 |
This patch removes the unused ebitmap, and then removes some sbitmap functions only used by ebitmap.
This patch removes the unused ebitmap, and then removes some sbitmap functions
only used by ebitmap. The functions removed are:
SET_BIT_WITH_POPCOUNT
RESET_BIT_WITH_POPCOUNT
bitmap_copy_n
bitmap_range_empty_p
sbitmap_popcount
In addition, two functions have been made private to the implementation file:
SBITMAP_SIZE_BYTES
sbitmap_verify_popcount
Tested on x86-64.
Index: gcc/ChangeLog
2012-11-01 Lawrence Crowl <crowl@google.com>
* ebitmap.h: Remove unused.
* ebitmap.c: Remove unused.
* Makefile.in: Remove ebitmap.h and ebitmap.c.
* sbitmap.h (SBITMAP_SIZE_BYTES): Move to source file.
(SET_BIT_WITH_POPCOUNT): Remove unused.
(RESET_BIT_WITH_POPCOUNT): Remove unused.
(bitmap_copy_n): Remove unused.
(bitmap_range_empty_p): Remove unused.
(sbitmap_popcount): Remove unused.
(sbitmap_verify_popcount): Make private to source file.
* sbitmap.c (SBITMAP_SIZE_BYTES): Move here from header.
(bitmap_copy_n): Remove unused.
(bitmap_range_empty_p): Remove unused.
(sbitmap_popcount): Remove unused.
(sbitmap_verify_popcount): Make private to source file.
2012-11-01 Lawrence Crowl <crowl@google.com>
From-SVN: r193072
Diffstat (limited to 'gcc/ebitmap.h')
-rw-r--r-- | gcc/ebitmap.h | 175 |
1 files changed, 0 insertions, 175 deletions
diff --git a/gcc/ebitmap.h b/gcc/ebitmap.h deleted file mode 100644 index fef3154..0000000 --- a/gcc/ebitmap.h +++ /dev/null @@ -1,175 +0,0 @@ -/* Sparse array based bitmaps. - Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 3, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING3. If not see -<http://www.gnu.org/licenses/>. */ - -#ifndef GCC_EBITMAP_H -#define GCC_EBITMAP_H - -#include "sbitmap.h" - -#define EBITMAP_ELT_BITS ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT) -#define EBITMAP_ELT_TYPE unsigned HOST_WIDEST_FAST_INT - -typedef struct ebitmap_def -{ - unsigned int n_elts; /* number of elements in the array. */ - sbitmap wordmask; /* wordmask saying which words are - nonzero. */ - unsigned int numwords; /* number of nonzero words. */ - unsigned int cacheindex; /* which word cache is. */ - EBITMAP_ELT_TYPE *elts; /* nonzero element array. */ - EBITMAP_ELT_TYPE *cache; /* last tested element, or NULL. */ -} *ebitmap; - - -inline bool bitmap_empty_p (ebitmap map) -{ - return map->numwords == 0; -} - -#define ebitmap_free(MAP) (free((MAP)->elts), \ - sbitmap_free ((MAP)->wordmask), \ - free((MAP))) - -extern void bitmap_set_bit (ebitmap, unsigned int); -extern void bitmap_clear_bit (ebitmap, unsigned int); -extern bool bitmap_bit_p (ebitmap, unsigned int); -extern void dump_bitmap (FILE *, ebitmap); -extern void dump_bitmap_file (FILE *, ebitmap); -extern void dump_bitmap_vector (FILE *, const char *, const char *, ebitmap *, - int); -extern ebitmap ebitmap_alloc (unsigned int); -extern ebitmap *ebitmap_vector_alloc (unsigned int, unsigned int); -extern void bitmap_copy (ebitmap, ebitmap); -extern void bitmap_and (ebitmap, ebitmap, ebitmap); -extern void bitmap_and_into (ebitmap, ebitmap); -extern bool bitmap_and_compl (ebitmap, ebitmap, ebitmap); -extern bool bitmap_and_compl_into (ebitmap, ebitmap); -extern bool bitmap_ior_into (ebitmap, ebitmap); -extern bool bitmap_ior (ebitmap, ebitmap, ebitmap); -extern bool bitmap_ior_and_compl (ebitmap, ebitmap, ebitmap, ebitmap); -extern bool bitmap_ior_and_compl_into (ebitmap, ebitmap, ebitmap); -extern bool bitmap_equal_p (ebitmap, ebitmap); -extern void bitmap_clear (ebitmap); -extern int bitmap_last_set_bit (ebitmap); -extern void debug_bitmap (ebitmap); -extern unsigned long bitmap_popcount(ebitmap, unsigned long); - -/* The iterator for ebitmap. */ -typedef struct { - /* The pointer to the first word of the bitmap. */ - EBITMAP_ELT_TYPE *ptr; - - /* Element number inside ptr that we are at. */ - unsigned int eltnum; - - /* The size of the bitmap. */ - unsigned int size; - - /* Current bit index. */ - unsigned int bit_num; - - /* The words currently visited. */ - EBITMAP_ELT_TYPE word; - - /* The word mask iterator. */ - sbitmap_iterator maskiter; -} ebitmap_iterator; - -static inline void -ebitmap_iter_init (ebitmap_iterator *i, ebitmap bmp, unsigned int min) -{ - unsigned unused; - bmp_iter_set_init (&i->maskiter, bmp->wordmask, - min / EBITMAP_ELT_BITS, &unused); - i->size = bmp->numwords; - if (i->size == 0) - { - i->ptr = NULL; - i->eltnum = 0; - i->bit_num = 0; - i->word = 0; - return; - } - i->ptr = bmp->elts; - i->bit_num = min; - i->eltnum = 0; - - if ((min / EBITMAP_ELT_BITS) >= bmp->wordmask->n_bits) - { - i->word = 0; - } - else - { - if (bitmap_bit_p (bmp->wordmask, min / EBITMAP_ELT_BITS) == 0) - i->word = 0; - else - { - unsigned int wordindex = min / EBITMAP_ELT_BITS; - unsigned int count = sbitmap_popcount (bmp->wordmask, wordindex); - i->word = i->ptr[count] >> (i->bit_num % (unsigned int)EBITMAP_ELT_BITS); - i->eltnum = count + 1; - } - } -} - -static inline bool -ebitmap_iter_cond (ebitmap_iterator *i, unsigned int *n) -{ - unsigned int ourn = 0; - unsigned unused; - - if (i->size == 0) - return false; - - if (i->word == 0) - { - bmp_iter_next (&i->maskiter, &unused); - if (!bmp_iter_set (&i->maskiter, &ourn)) - return false; - i->bit_num = ourn * EBITMAP_ELT_BITS; - i->word = i->ptr[i->eltnum++]; - } - - /* Skip bits that are zero. */ - - for (; (i->word & 1) == 0; i->word >>= 1) - i->bit_num++; - - *n = i->bit_num; - return true; -} - -static inline void -ebitmap_iter_next (ebitmap_iterator *i) -{ - i->word >>= 1; - i->bit_num++; -} - -/* Loop over all elements of EBITMAP, starting with MIN. In each - iteration, N is set to the index of the bit being visited. ITER is - an instance of ebitmap_iterator used to iterate the bitmap. */ - -#define EXECUTE_IF_SET_IN_EBITMAP(EBITMAP, MIN, N, ITER) \ - for (ebitmap_iter_init (&(ITER), (EBITMAP), (MIN)); \ - ebitmap_iter_cond (&(ITER), &(N)); \ - ebitmap_iter_next (&(ITER))) - - -#endif /* ! GCC_EBITMAP_H */ |