Add a SmallBitVector class, which mimics BitVector but uses only
authorDan Gohman <gohman@apple.com>
Tue, 5 Jan 2010 15:04:49 +0000 (15:04 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 5 Jan 2010 15:04:49 +0000 (15:04 +0000)
commitcb89afc965c66029ae38712d1c52f5bbe4dee942
tree7183d835b6819e6c34f8162fdbd5bd3ce53a18bd
parenteade00209447c07953a609b30666ce5f6d9f9864
Add a SmallBitVector class, which mimics BitVector but uses only
a single pointer (PointerIntPair) member. In "small" mode, the
pointer field is reinterpreted as a set of bits. In "large" mode,
the pointer points to a heap-allocated object.

Also, give BitVector empty and swap functions.

And, add some simple unittests for BitVector and SmallBitVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92730 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/BitVector.h
include/llvm/ADT/SmallBitVector.h [new file with mode: 0644]
unittests/ADT/BitVectorTest.cpp [new file with mode: 0644]
unittests/ADT/SmallBitVectorTest.cpp [new file with mode: 0644]