add a method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35860 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-04-10 06:43:18 +00:00
parent eb13d1b710
commit 4bda52d6b5

View File

@ -281,6 +281,13 @@ public:
return *this != 0;
}
/// getLimitedValue - Return this value, or return all ones if it is too large
/// to return.
uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const {
return (getActiveBits() > 64 || getZExtValue() > Limit) ?
Limit : getZExtValue();
}
/// @}
/// @name Value Generators
/// @{