diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-11-06 18:34:40 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-11-06 18:34:40 +0000 |
| commit | 21d8b9f0d63b5704b678c32cfac16ffcb39f1f4b (patch) | |
| tree | 32c10db6e5f62e7482d27246ab387386cb2d3e39 /llvm/include/Support/BitSetVector.h | |
| parent | 92acbcda99be6e1c4be4dd4d6fd3205d0d7f9807 (diff) | |
| download | bcm5719-llvm-21d8b9f0d63b5704b678c32cfac16ffcb39f1f4b.tar.gz bcm5719-llvm-21d8b9f0d63b5704b678c32cfac16ffcb39f1f4b.zip | |
Make maxSize a private variable, add a size() accessor
llvm-svn: 4573
Diffstat (limited to 'llvm/include/Support/BitSetVector.h')
| -rw-r--r-- | llvm/include/Support/BitSetVector.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/include/Support/BitSetVector.h b/llvm/include/Support/BitSetVector.h index 0143413b3d4..d7971b1b79b 100644 --- a/llvm/include/Support/BitSetVector.h +++ b/llvm/include/Support/BitSetVector.h @@ -41,6 +41,7 @@ class BitSetVector { class iterator; std::vector<bitword> bitsetVec; + unsigned maxSize; static unsigned NumWords(unsigned Size) { return (Size+WORDSIZE-1)/WORDSIZE;} @@ -53,14 +54,15 @@ class BitSetVector { BitSetVector(); // do not implement! public: - unsigned maxSize; - /// /// Constructor: create a set of the maximum size maxSetSize. /// The set is initialized to empty. /// BitSetVector(unsigned maxSetSize) - : bitsetVec(BitSetVector::NumWords(maxSetSize)), maxSize(maxSetSize) { } + : bitsetVec(NumWords(maxSetSize)), maxSize(maxSetSize) { } + + /// size - Return the number of bits tracked by this bit vector... + unsigned size() const { return maxSize; } /// /// Modifier methods: reset, set for entire set, operator[] for one element. @@ -229,7 +231,7 @@ inline std::ostream& operator<< (std::ostream& O, const BitSetVector& bset) inline bool Disjoint(const BitSetVector& set1, const BitSetVector& set2) { - assert(set1.maxSize == set2.maxSize && "Illegal intersection"); + assert(set1.size() == set2.size() && "Illegal intersection"); for (unsigned i = 0; i < set1.bitsetVec.size(); ++i) if ((set1.getWord(i) & set2.getWord(i)).any()) return false; |

