aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/BitVector.h
Commit message (Collapse)AuthorAgeFilesLines
* Add a SmallBitVector class, which mimics BitVector but uses onlyDan Gohman2010-01-051-0/+18
| | | | | | | | | | | | | 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
* Use CHAR_BIT instead of hard-coding 8 in several places where itDan Gohman2009-04-011-1/+2
| | | | | | | | is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68227 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in BitVector.h. All assignment operations (except the usual Roman Levenstein2009-01-261-3/+3
| | | | | | | | | | assignment operator) were returning a copy of the bit vector, instead of a reference! This old semantics probably did not meet the expectations. With this patch, chained assignments happen to the right object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63012 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed trailing whitespace.Misha Brukman2009-01-091-17/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62000 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune and tidy #includes.Dan Gohman2008-05-291-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51697 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix more -Wshorten-64-to-32 warnings.Evan Cheng2008-05-051-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-1/+2
| | | | | | annoying warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | | | discussion of this change. Boy are my fingers tired. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
* Added two bounds checks to the BitVector class to detectTed Kremenek2007-12-101-0/+4
| | | | | | | | out-of-bounds bit accesses. The checks are only performed in a Debug build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44815 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated VC++ build system.Hartmut Kaiser2007-10-171-1/+1
| | | | | | | | | | | | | | | | Silenced some VC warnings. I'm getting linker errors, though: unresolved externals: llvm::Split<class llvm::BasicBlock *,struct llvm::GraphTraits<class llvm::BasicBlock *> >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *) and llvm::Split<struct llvm::Inverse<class llvm::BasicBlock *>,struct llvm::GraphTraits<struct llvm::Inverse<class llvm::BasicBlock *> > >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *) Where are these defined? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43073 91177308-0d34-0410-b5e6-96231b3b80d8
* make operator== work with non-equal sized bitvectors, as long as Chris Lattner2007-10-121-4/+15
| | | | | | | | the extra bits are all zeros. This allows "010" and "010000" to be treated as equal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42889 91177308-0d34-0410-b5e6-96231b3b80d8
* make bitvector &= do the right thing if vectors have mismatched length.Chris Lattner2007-10-111-2/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42860 91177308-0d34-0410-b5e6-96231b3b80d8
* This fixes resizing issues with BitVectors. It ensures that the BitWord type ↵Chandler Carruth2007-08-061-11/+26
| | | | | | and type size is always used, and ensures completely correct clearing of unused high bits, and setting of bits when resizing. It should resolve PR1563. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40871 91177308-0d34-0410-b5e6-96231b3b80d8
* Evidently my earlier fix did not go far enough. When resizing a zero-sizedOwen Anderson2007-07-101-1/+2
| | | | | | | BitVector, make sure to set or clear ALL of the bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38481 91177308-0d34-0410-b5e6-96231b3b80d8
* When resizing a BitVector with size 0, be sure to clear the low word before ↵Owen Anderson2007-07-091-0/+5
| | | | | | using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38476 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename identifier that GCC uses as a macro, breaking llvm-gcc build.Jeff Cohen2007-04-261-22/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36474 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed tabs everywhere except autogenerated & external files. Add makeAnton Korobeynikov2007-04-161-15/+15
| | | | | | | target for tabs checking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36146 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix release build.Lauro Ramos Venancio2007-04-041-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35676 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly emit range comparisons for switch cases, where neighbour casesAnton Korobeynikov2007-04-041-0/+2
| | | | | | | | go to the same destination. Now we're producing really good code for switch-lower-feature.ll testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35672 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a dtor to fix leaks from all clients of BitVector.Chris Lattner2007-03-201-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35200 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it 64-bit safe.Evan Cheng2007-03-021-7/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34829 91177308-0d34-0410-b5e6-96231b3b80d8
* Proper fix for the off-by-one bug in clear_unused_bits().Evan Cheng2007-02-151-5/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34328 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an off-by-one bug in computing the index of the word to clear.Reid Spencer2007-02-151-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34326 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure Capacity gets initialized too.Reid Spencer2007-02-151-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34325 91177308-0d34-0410-b5e6-96231b3b80d8
* Missing a ;Evan Cheng2007-02-151-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34322 91177308-0d34-0410-b5e6-96231b3b80d8
* BitVector::reference operator=(const reference& rhs) is unnecessary thanks ↵Evan Cheng2007-02-151-8/+0
| | | | | | to autoconvert to bool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34320 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary checks.Evan Cheng2007-02-151-10/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34319 91177308-0d34-0410-b5e6-96231b3b80d8
* operator== returns false when two bitvectors have different sizes.Evan Cheng2007-02-151-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34317 91177308-0d34-0410-b5e6-96231b3b80d8
* Merges two resize() variants.Evan Cheng2007-02-151-11/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34316 91177308-0d34-0410-b5e6-96231b3b80d8
* Clear no longer deleting the bits to avoid mallocs.Evan Cheng2007-02-151-5/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34315 91177308-0d34-0410-b5e6-96231b3b80d8
* BitVector::count() bugs.Evan Cheng2007-02-151-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34314 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate a redundent ctor; eliminate one more potential new [0].Evan Cheng2007-02-151-10/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34313 91177308-0d34-0410-b5e6-96231b3b80d8
* 1 -> 1L since BitWord has type unsigned long.Evan Cheng2007-02-151-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34312 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate new[0], just set Bits to NULL.Evan Cheng2007-02-151-11/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34311 91177308-0d34-0410-b5e6-96231b3b80d8
* Inverted the condition by accident.Evan Cheng2007-02-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34309 91177308-0d34-0410-b5e6-96231b3b80d8
* Bug fixes: assignment operator forgot to copy over size; copy ctor forgot to ↵Evan Cheng2007-02-151-5/+6
| | | | | | clear unused top bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34305 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a BitVector class.Evan Cheng2007-02-151-0/+347
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34301 91177308-0d34-0410-b5e6-96231b3b80d8