Fix isIntN to work with APInts > 64 bits. This method is only

used by clang apparently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60446 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-12-02 23:33:29 +00:00
parent 96da041949
commit 1d93b2e1b6

View File

@ -333,12 +333,14 @@ public:
/// @brief Check if this APInt has an N-bits unsigned integer value.
bool isIntN(uint32_t N) const {
assert(N && "N == 0 ???");
if (isSingleWord()) {
if (N >= getBitWidth())
return true;
if (isSingleWord())
return VAL == (VAL & (~0ULL >> (64 - N)));
} else {
APInt Tmp(N, getNumWords(), pVal);
return Tmp == (*this);
}
APInt Tmp(N, getNumWords(), pVal);
Tmp.zext(getBitWidth());
return Tmp == (*this);
}
/// @brief Check if this APInt has an N-bits signed integer value.