From 7ab83427af0f77b59941ceba41d509d7d097b065 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 10 Jun 2017 13:44:06 +0000 Subject: Vendor import of llvm trunk r305145: https://llvm.org/svn/llvm-project/llvm/trunk@305145 --- include/llvm/ADT/APInt.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/llvm/ADT/APInt.h') 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 -- cgit v1.2.3