summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/APInt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/APInt.h')
-rw-r--r--include/llvm/ADT/APInt.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index fe75e25bd8d2..ef9c66d2d700 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -392,6 +392,11 @@ public:
/// not.
bool isNullValue() const { return !*this; }
+ /// \brief Determine if this is a value of 1.
+ ///
+ /// This checks to see if the value of this APInt is one.
+ bool isOneValue() const { return getActiveBits() == 1; }
+
/// \brief Determine if this is the largest unsigned value.
///
/// This checks to see if the value of this APInt is the maximum unsigned