aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/ADT/APInt.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index 3d479da4b8..f609f61e13 100644
--- 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;