llvm.org GIT mirror llvm / 1d93b2e
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 Chris Lattner 11 years ago
1 changed file(s) with 7 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
332332 /// @brief Check if this APInt has an N-bits unsigned integer value.
333333 bool isIntN(uint32_t N) const {
334334 assert(N && "N == 0 ???");
335 if (isSingleWord()) {
335 if (N >= getBitWidth())
336 return true;
337
338 if (isSingleWord())
336339 return VAL == (VAL & (~0ULL >> (64 - N)));
337 } else {
338 APInt Tmp(N, getNumWords(), pVal);
339 return Tmp == (*this);
340 }
340 APInt Tmp(N, getNumWords(), pVal);
341 Tmp.zext(getBitWidth());
342 return Tmp == (*this);
341343 }
342344
343345 /// @brief Check if this APInt has an N-bits signed integer value.