Fix a warning about comparison between signed and unsigned,
authorDan Gohman <gohman@apple.com>
Thu, 14 Feb 2008 22:38:45 +0000 (22:38 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 14 Feb 2008 22:38:45 +0000 (22:38 +0000)
being consistent with the rest of the APInt implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47138 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/APInt.cpp

index c8482e9c7195262459536a2bbf1afadd346df7a3..9886de83dc4de63c064e8b0fbc30190b2a2bb827 100644 (file)
@@ -818,7 +818,7 @@ uint32_t APInt::countTrailingOnes() const {
     return std::min(uint32_t(CountTrailingOnes_64(VAL)), BitWidth);
   uint32_t Count = 0;
   uint32_t i = 0;
-  for (; i < getNumWords() && pVal[i] == -1; ++i)
+  for (; i < getNumWords() && pVal[i] == -1ULL; ++i)
     Count += APINT_BITS_PER_WORD;
   if (i < getNumWords())
     Count += CountTrailingOnes_64(pVal[i]);