projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb13d1b
)
add a method
author
Chris Lattner
<sabre@nondot.org>
Tue, 10 Apr 2007 06:43:18 +0000
(06:43 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Tue, 10 Apr 2007 06:43:18 +0000
(06:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35860
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/APInt.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/APInt.h
b/include/llvm/ADT/APInt.h
index d80c601d274909a9775538a67a89930bb12bf948..c514d24bcf13484d45de9f8669895d12487c278f 100644
(file)
--- a/
include/llvm/ADT/APInt.h
+++ b/
include/llvm/ADT/APInt.h
@@
-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
/// @{