diff options
-rw-r--r-- | include/llvm/Constants.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 21d9dca7a7..7257d2645a 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -127,6 +127,13 @@ public: return Val == 0; } + /// This is just a convenience method to make client code smaller for a + /// common case. + /// @brief Determine if the value is one. + virtual bool isUnitValue() const { + return Val == 1; + } + /// This function will return true iff every bit in this constant is set /// to true. /// @returns true iff this constant's bits are all set to true. |