llvm.org GIT mirror llvm / 8fb1fe1
Fix problems with BitSetVector that makes it not compile under GCC 3.0 and 2.95 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5745 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
2 changed file(s) with 12 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
193193 iterator(const iterator& I)
194194 : currentBit(I.currentBit),currentWord(I.currentWord),bitvec(I.bitvec) { }
195195 iterator& operator=(const iterator& I) {
196 currentWord == I.currentWord;
197 currentBit == I.currentBit;
196 currentWord = I.currentWord;
197 currentBit = I.currentBit;
198198 bitvec = I.bitvec;
199199 return *this;
200200 }
202202 // Increment and decrement operators (pre and post)
203203 iterator& operator++() {
204204 if (++currentBit == WORDSIZE)
205 { currentBit = 0; if (currentWord < bitvec->maxSize) ++currentWord; }
205 { currentBit = 0; if (currentWord < bitvec->size()) ++currentWord; }
206206 return *this;
207207 }
208208 iterator& operator--() {
209209 if (currentBit == 0) {
210210 currentBit = WORDSIZE-1;
211 currentWord = (currentWord == 0)? bitvec->maxSize : --currentWord;
211 currentWord = (currentWord == 0)? bitvec->size() : --currentWord;
212212 }
213213 else
214214 --currentBit;
219219
220220 // Dereferencing operators
221221 reference operator*() {
222 assert(currentWord < bitvec->maxSize &&
222 assert(currentWord < bitvec->size() &&
223223 "Dereferencing iterator past the end of a BitSetVector");
224224 return bitvec->getWord(currentWord)[currentBit];
225225 }
233233 protected:
234234 static iterator begin(BitSetVector& _bitvec) { return iterator(_bitvec); }
235235 static iterator end(BitSetVector& _bitvec) { return iterator(0,
236 _bitvec.maxSize, _bitvec); }
236 _bitvec.size(), _bitvec); }
237237 friend class BitSetVector;
238238 };
239239 };
193193 iterator(const iterator& I)
194194 : currentBit(I.currentBit),currentWord(I.currentWord),bitvec(I.bitvec) { }
195195 iterator& operator=(const iterator& I) {
196 currentWord == I.currentWord;
197 currentBit == I.currentBit;
196 currentWord = I.currentWord;
197 currentBit = I.currentBit;
198198 bitvec = I.bitvec;
199199 return *this;
200200 }
202202 // Increment and decrement operators (pre and post)
203203 iterator& operator++() {
204204 if (++currentBit == WORDSIZE)
205 { currentBit = 0; if (currentWord < bitvec->maxSize) ++currentWord; }
205 { currentBit = 0; if (currentWord < bitvec->size()) ++currentWord; }
206206 return *this;
207207 }
208208 iterator& operator--() {
209209 if (currentBit == 0) {
210210 currentBit = WORDSIZE-1;
211 currentWord = (currentWord == 0)? bitvec->maxSize : --currentWord;
211 currentWord = (currentWord == 0)? bitvec->size() : --currentWord;
212212 }
213213 else
214214 --currentBit;
219219
220220 // Dereferencing operators
221221 reference operator*() {
222 assert(currentWord < bitvec->maxSize &&
222 assert(currentWord < bitvec->size() &&
223223 "Dereferencing iterator past the end of a BitSetVector");
224224 return bitvec->getWord(currentWord)[currentBit];
225225 }
233233 protected:
234234 static iterator begin(BitSetVector& _bitvec) { return iterator(_bitvec); }
235235 static iterator end(BitSetVector& _bitvec) { return iterator(0,
236 _bitvec.maxSize, _bitvec); }
236 _bitvec.size(), _bitvec); }
237237 friend class BitSetVector;
238238 };
239239 };