diff options
Diffstat (limited to 'include/llvm/ADT/BitVector.h')
-rw-r--r-- | include/llvm/ADT/BitVector.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h index a3a8920186..fccb1c6e8a 100644 --- a/include/llvm/ADT/BitVector.h +++ b/include/llvm/ADT/BitVector.h @@ -25,7 +25,7 @@ namespace llvm { class BitVector { typedef unsigned long BitWord; - enum { BITWORD_SIZE = sizeof(BitWord) * 8 }; + enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * 8 }; BitWord *Bits; // Actual bits. unsigned Size; // Size of bitvector in bits. @@ -103,7 +103,7 @@ public: unsigned NumBits = 0; for (unsigned i = 0; i < NumBitWords(size()); ++i) if (sizeof(BitWord) == 4) - NumBits += CountPopulation_32(Bits[i]); + NumBits += CountPopulation_32((uint32_t)Bits[i]); else if (sizeof(BitWord) == 8) NumBits += CountPopulation_64(Bits[i]); else @@ -130,7 +130,7 @@ public: for (unsigned i = 0; i < NumBitWords(size()); ++i) if (Bits[i] != 0) { if (sizeof(BitWord) == 4) - return i * BITWORD_SIZE + CountTrailingZeros_32(Bits[i]); + return i * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Bits[i]); else if (sizeof(BitWord) == 8) return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]); else @@ -154,7 +154,7 @@ public: if (Copy != 0) { if (sizeof(BitWord) == 4) - return WordPos * BITWORD_SIZE + CountTrailingZeros_32(Copy); + return WordPos * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Copy); else if (sizeof(BitWord) == 8) return WordPos * BITWORD_SIZE + CountTrailingZeros_64(Copy); else @@ -165,7 +165,7 @@ public: for (unsigned i = WordPos+1; i < NumBitWords(size()); ++i) if (Bits[i] != 0) { if (sizeof(BitWord) == 4) - return i * BITWORD_SIZE + CountTrailingZeros_32(Bits[i]); + return i * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Bits[i]); else if (sizeof(BitWord) == 8) return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]); else |