[llvm-commits] CVS: llvm/include/llvm/ADT/BitVector.h

Evan Cheng evan.cheng at apple.com
Thu Feb 15 11:12:55 PST 2007



Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.8 -> 1.9
---
Log message:

Merges two resize() variants.

---
Diffs of the changes:  (+3 -11)

 BitVector.h |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.8 llvm/include/llvm/ADT/BitVector.h:1.9
--- llvm/include/llvm/ADT/BitVector.h:1.8	Thu Feb 15 13:10:34 2007
+++ llvm/include/llvm/ADT/BitVector.h	Thu Feb 15 13:12:39 2007
@@ -161,23 +161,15 @@
   }
 
   /// resize - Grow or shrink the bitvector.
-  void resize(unsigned N) {
-    if (N > Capacity * BITS_PER_WORD) {
-      unsigned OldCapacity = Capacity;
-      grow(N);
-      init_words(&Bits[OldCapacity], (Capacity-OldCapacity), false);
-    }
-    Size = N;
-  }
-
-  void resize(unsigned N, bool t) {
+  void resize(unsigned N, bool t = false) {
     if (N > Capacity * BITS_PER_WORD) {
       unsigned OldCapacity = Capacity;
       grow(N);
       init_words(&Bits[OldCapacity], (Capacity-OldCapacity), t);
     }
     Size = N;
-    clear_unused_bits();
+    if (t)
+      clear_unused_bits();
   }
 
   void reserve(unsigned N) {






More information about the llvm-commits mailing list