[llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h
Chris Lattner
sabre at nondot.org
Mon Apr 9 23:43:35 PDT 2007
Changes in directory llvm/include/llvm/ADT:
APInt.h updated: 1.63 -> 1.64
---
Log message:
add a method
---
Diffs of the changes: (+7 -0)
APInt.h | 7 +++++++
1 files changed, 7 insertions(+)
Index: llvm/include/llvm/ADT/APInt.h
diff -u llvm/include/llvm/ADT/APInt.h:1.63 llvm/include/llvm/ADT/APInt.h:1.64
--- llvm/include/llvm/ADT/APInt.h:1.63 Wed Apr 4 01:18:21 2007
+++ llvm/include/llvm/ADT/APInt.h Tue Apr 10 01:43:18 2007
@@ -281,6 +281,13 @@
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
/// @{
More information about the llvm-commits
mailing list