mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-20 00:43:48 +00:00
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:
parent
96da041949
commit
1d93b2e1b6
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user