|
LLVM
3.7.0
|
SparseBitVector is an implementation of a bitvector that is sparse by only storing the elements that have non-zero bits set. More...
#include <SparseBitVector.h>
Public Types | |
| enum | { BITWORD_SIZE = sizeof(BitWord) * CHAR_BIT, BITWORDS_PER_ELEMENT = (ElementSize + BITWORD_SIZE - 1) / BITWORD_SIZE, BITS_PER_ELEMENT = ElementSize } |
| typedef unsigned long | BitWord |
| typedef unsigned | size_type |
Friends | |
| struct | ilist_sentinel_traits< SparseBitVectorElement > |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::ilist_node< SparseBitVectorElement< ElementSize > > | |
| ilist_node () | |
SparseBitVector is an implementation of a bitvector that is sparse by only storing the elements that have non-zero bits set.
In order to make this fast for the most common cases, SparseBitVector is implemented as a linked list of SparseBitVectorElements. We maintain a pointer to the last SparseBitVectorElement accessed (in the form of a list iterator), in order to make multiple in-order test/set constant time after the first one is executed. Note that using vectors to store SparseBitVectorElement's does not work out very well because it causes insertion in the middle to take enormous amounts of time with a large amount of bits. Other structures that have better worst cases for insertion in the middle (various balanced trees, etc) do not perform as well in practice as a linked list with this iterator kept up to date. They are also significantly more memory intensive.
Definition at line 44 of file SparseBitVector.h.
| typedef unsigned long llvm::SparseBitVectorElement< ElementSize >::BitWord |
Definition at line 47 of file SparseBitVector.h.
| typedef unsigned llvm::SparseBitVectorElement< ElementSize >::size_type |
Definition at line 48 of file SparseBitVector.h.
| anonymous enum |
| Enumerator | |
|---|---|
| BITWORD_SIZE | |
| BITWORDS_PER_ELEMENT | |
| BITS_PER_ELEMENT | |
Definition at line 49 of file SparseBitVector.h.
|
inlineexplicit |
Definition at line 67 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT.
|
inline |
Definition at line 124 of file SparseBitVector.h.
References llvm::tgtok::Bits, llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT, and llvm::countPopulation().
|
inline |
Definition at line 96 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT.
|
inline |
find_first - Returns the index of the first set bit.
Definition at line 132 of file SparseBitVector.h.
References llvm::tgtok::Bits, llvm::SparseBitVectorElement< ElementSize >::BITWORD_SIZE, llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT, llvm::countTrailingZeros(), and llvm_unreachable.
Referenced by llvm::SparseBitVector< ElementSize >::find_first().
|
inline |
find_next - Returns the index of the next set bit starting from the "Curr" bit.
Returns -1 if the next set bit is not found.
Definition at line 141 of file SparseBitVector.h.
References llvm::tgtok::Bits, llvm::SparseBitVectorElement< ElementSize >::BITS_PER_ELEMENT, llvm::SparseBitVectorElement< ElementSize >::BITWORD_SIZE, llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT, and llvm::countTrailingZeros().
|
inline |
Definition at line 92 of file SparseBitVector.h.
Referenced by llvm::SparseBitVector< ElementSize >::find_first().
|
inline |
Definition at line 178 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT.
|
inline |
Definition at line 188 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT.
|
inline |
Definition at line 210 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT.
Referenced by llvm::SparseBitVector< ElementSize >::intersectWithComplement().
|
inline |
Definition at line 231 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT.
|
inline |
Definition at line 82 of file SparseBitVector.h.
|
inline |
Definition at line 73 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT.
|
inline |
Definition at line 116 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORD_SIZE.
|
inline |
Definition at line 103 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORD_SIZE.
Referenced by llvm::SparseBitVectorElement< ElementSize >::test_and_set().
|
inline |
Definition at line 120 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORD_SIZE.
Referenced by llvm::SparseBitVectorElement< ElementSize >::test_and_set().
|
inline |
Definition at line 107 of file SparseBitVector.h.
References llvm::SparseBitVectorElement< ElementSize >::set(), and llvm::SparseBitVectorElement< ElementSize >::test().
|
inline |
Definition at line 165 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT.
|
inline |
Definition at line 87 of file SparseBitVector.h.
References llvm::tgtok::Bits, and llvm::SparseBitVectorElement< ElementSize >::BITWORDS_PER_ELEMENT.
|
friend |
Definition at line 60 of file SparseBitVector.h.
1.8.6