From: Eugene Zelenko Date: Tue, 13 Jun 2017 22:32:38 +0000 (+0000) Subject: [ADT] Revert r305326 changes in BitVector.h to fix broken builds. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60ef905f43c8c0e7ab847eaace1c7a65a4263e21;p=llvm [ADT] Revert r305326 changes in BitVector.h to fix broken builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305332 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h index e75bd645335..e68ef5f53d1 100644 --- a/include/llvm/ADT/BitVector.h +++ b/include/llvm/ADT/BitVector.h @@ -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 #include @@ -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 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 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 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; - 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 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