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

Evan Cheng evan.cheng at apple.com
Thu Feb 15 11:03:42 PST 2007



Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.4 -> 1.5
---
Log message:

1 -> 1L since BitWord has type unsigned long.

---
Diffs of the changes:  (+9 -9)

 BitVector.h |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.4 llvm/include/llvm/ADT/BitVector.h:1.5
--- llvm/include/llvm/ADT/BitVector.h:1.4	Thu Feb 15 12:59:15 2007
+++ llvm/include/llvm/ADT/BitVector.h	Thu Feb 15 13:03:23 2007
@@ -47,22 +47,22 @@
 
     reference& operator=(bool t) {
       if (t)
-        *WordRef |= 1 << BitPos;
+        *WordRef |= 1L << BitPos;
       else
-        *WordRef &= ~(1 << BitPos);
+        *WordRef &= ~(1L << BitPos);
       return *this;
     }
 
     reference& operator=(const reference& rhs) {
       if (*rhs.WordRef & (1 << rhs.BitPos))
-        *WordRef |= 1 << BitPos;
+        *WordRef |= 1L << BitPos;
       else
-        *WordRef &= ~(1 << BitPos);
+        *WordRef &= ~(1L << BitPos);
       return *this;
     }
 
     operator bool() const {
-      return (*WordRef) & (1 << BitPos);
+      return (*WordRef) & (1L << BitPos);
     }
   };
 
@@ -196,7 +196,7 @@
   }
 
   BitVector &set(unsigned Idx) {
-    Bits[Idx / BITS_PER_WORD] |= 1 << (Idx % BITS_PER_WORD);
+    Bits[Idx / BITS_PER_WORD] |= 1L << (Idx % BITS_PER_WORD);
     return *this;
   }
 
@@ -207,7 +207,7 @@
   }
 
   BitVector &reset(unsigned Idx) {
-    Bits[Idx / BITS_PER_WORD] &= ~(1 << (Idx % BITS_PER_WORD));
+    Bits[Idx / BITS_PER_WORD] &= ~(1L << (Idx % BITS_PER_WORD));
     return *this;
   }
 
@@ -219,7 +219,7 @@
   }
 
   BitVector &flip(unsigned Idx) {
-    Bits[Idx / BITS_PER_WORD] ^= 1 << (Idx % BITS_PER_WORD);
+    Bits[Idx / BITS_PER_WORD] ^= 1L << (Idx % BITS_PER_WORD);
     return *this;
   }
 
@@ -234,7 +234,7 @@
   }
 
   bool operator[](unsigned Idx) const {
-    BitWord Mask = 1 << (Idx % BITS_PER_WORD);
+    BitWord Mask = 1L << (Idx % BITS_PER_WORD);
     return (Bits[Idx / BITS_PER_WORD] & Mask) != 0;
   }
 






More information about the llvm-commits mailing list