aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Constants.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index f17e02a4aa..988b53a284 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -127,10 +127,18 @@ public:
return Val == 0;
}
+ /// This is just a convenience method to make client code smaller for a
+ /// common code. It also correctly performs the comparison without the
+ /// potential for an assertion from getZExtValue().
+ bool isZero() const {
+ return Val == 0;
+ }
+
/// This is just a convenience method to make client code smaller for a
- /// common case.
+ /// common case. It also correctly performs the comparison without the
+ /// potential for an assertion from getZExtValue().
/// @brief Determine if the value is one.
- bool isUnitValue() const {
+ bool isOne() const {
return Val == 1;
}