[llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h
Zhou Sheng
zhousheng00 at gmail.com
Sun Mar 18 22:22:37 PDT 2007
Changes in directory llvm/include/llvm/ADT:
APInt.h updated: 1.42 -> 1.43
---
Log message:
Add isStrictPositive() to APInt to determine if this APInt Value > 0.
---
Diffs of the changes: (+6 -0)
APInt.h | 6 ++++++
1 files changed, 6 insertions(+)
Index: llvm/include/llvm/ADT/APInt.h
diff -u llvm/include/llvm/ADT/APInt.h:1.42 llvm/include/llvm/ADT/APInt.h:1.43
--- llvm/include/llvm/ADT/APInt.h:1.42 Tue Mar 13 01:16:26 2007
+++ llvm/include/llvm/ADT/APInt.h Mon Mar 19 00:22:18 2007
@@ -374,6 +374,12 @@
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;
More information about the llvm-commits
mailing list