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

Eugene Zelenko via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 15:32:38 PDT 2017


Author: eugenezelenko
Date: Tue Jun 13 17:32:38 2017
New Revision: 305332

URL: http://llvm.org/viewvc/llvm-project?rev=305332&view=rev
Log:
[ADT] Revert r305326 changes in BitVector.h to fix broken builds.

Modified:
    llvm/trunk/include/llvm/ADT/BitVector.h

Modified: llvm/trunk/include/llvm/ADT/BitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/BitVector.h?rev=305332&r1=305331&r2=305332&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/BitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/BitVector.h Tue Jun 13 17:32:38 2017
@@ -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(c
 } // 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




More information about the llvm-commits mailing list