add a method

llvm-svn: 35860
This commit is contained in:
Chris Lattner 2007-04-10 06:43:18 +00:00
parent 9b6d69e0c2
commit c43883c8a9
1 changed files with 7 additions and 0 deletions

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
/// @{