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:
79b0984
)
Add isStrictPositive() to APInt to determine if this APInt Value > 0.
author
Zhou Sheng
<zhousheng00@gmail.com>
Mon, 19 Mar 2007 05:22:18 +0000
(
05:22
+0000)
committer
Zhou Sheng
<zhousheng00@gmail.com>
Mon, 19 Mar 2007 05:22:18 +0000
(
05:22
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35156
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 3d479da4b8340b5648b78932c32f2424979d1617..f609f61e1381d5fddf80169015d41bd1a6f8e2cb 100644
(file)
--- a/
include/llvm/ADT/APInt.h
+++ b/
include/llvm/ADT/APInt.h
@@
-374,6
+374,12
@@
public:
return !isNegative();
}
+ /// This just tests if the value of this APInt is strictly positive (> 0).
+ /// @brief Determine if this APInt Value is strictly positive.
+ inline bool isStrictPositive() const {
+ return isPositive() && (*this) != 0;
+ }
+
/// Arithmetic right-shift this APInt by shiftAmt.
/// @brief Arithmetic right-shift function.
APInt ashr(uint32_t shiftAmt) const;