AND vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37586
91177308-0d34-0410-b5e6-
96231b3b80d8
///
static Constant *getNullValue(const Type *Ty);
+ /// Static constructor to get a '-1' constant. This supports integers and
+ /// vectors.
+ ///
+ static Constant *getAllOnesValue(const Type *Ty);
+
/// isNullValue - Return true if this is the value that would be returned by
/// getNullValue.
virtual bool isNullValue() const = 0;
}
}
+Constant *Constant::getAllOnesValue(const Type *Ty) {
+ if (const IntegerType* ITy = dyn_cast<IntegerType>(Ty))
+ return ConstantInt::get(APInt::getAllOnesValue(ITy->getBitWidth()));
+ return ConstantVector::getAllOnesValue(cast<VectorType>(Ty));
+}
// Static constructor to create an integral constant with all bits set
ConstantInt *ConstantInt::getAllOnesValue(const Type *Ty) {