1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[ADT] Revert r305326 changes in BitVector.h to fix broken builds.

llvm-svn: 305332
This commit is contained in:
Eugene Zelenko 2017-06-13 22:32:38 +00:00
parent 2eca2a2e62
commit 88a928e194

View File

@ -16,7 +16,6 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
#include <cassert>
@ -73,7 +72,7 @@ public:
};
class BitVector {
using BitWord = unsigned long;
typedef unsigned long BitWord;
enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * CHAR_BIT };
@ -81,11 +80,10 @@ class BitVector {
"Unsupported word size");
MutableArrayRef<BitWord> Bits; // Actual bits.
unsigned Size = 0; // Size of bitvector in bits.
unsigned Size; // Size of bitvector in bits.
public:
using size_type = unsigned;
typedef unsigned size_type;
// Encapsulation of a single bit.
class reference {
friend class BitVector;
@ -120,8 +118,21 @@ public:
}
};
typedef const_set_bits_iterator_impl<BitVector> const_set_bits_iterator;
typedef const_set_bits_iterator set_iterator;
const_set_bits_iterator set_bits_begin() const {
return const_set_bits_iterator(*this);
}
const_set_bits_iterator set_bits_end() const {
return const_set_bits_iterator(*this, -1);
}
iterator_range<const_set_bits_iterator> set_bits() const {
return make_range(set_bits_begin(), set_bits_end());
}
/// BitVector default ctor - Creates an empty bitvector.
BitVector() = default;
BitVector() : Size(0) {}
/// BitVector ctor - Creates a bitvector of specified number of bits. All
/// bits are initialized to the specified value.
@ -152,21 +163,6 @@ public:
~BitVector() { std::free(Bits.data()); }
using const_set_bits_iterator = const_set_bits_iterator_impl<BitVector>;
using set_iterator = const_set_bits_iterator;
const_set_bits_iterator set_bits_begin() const {
return const_set_bits_iterator(*this);
}
const_set_bits_iterator set_bits_end() const {
return const_set_bits_iterator(*this, -1);
}
iterator_range<const_set_bits_iterator> set_bits() const {
return make_range(set_bits_begin(), set_bits_end());
}
/// empty - Tests whether there are no bits in this bitvector.
bool empty() const { return Size == 0; }
@ -922,13 +918,11 @@ static inline size_t capacity_in_bytes(const BitVector &X) {
} // end namespace llvm
namespace std {
/// Implement std::swap in terms of BitVector swap.
inline void
swap(llvm::BitVector &LHS, llvm::BitVector &RHS) {
LHS.swap(RHS);
}
/// Implement std::swap in terms of BitVector swap.
inline void
swap(llvm::BitVector &LHS, llvm::BitVector &RHS) {
LHS.swap(RHS);
}
} // end namespace std
#endif // LLVM_ADT_BITVECTOR_H