mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-14 15:39:00 +00:00
Add a new ConstantPacked::getAllOnesValue method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32856 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8688428b05
commit
58513aa1c2
@ -422,6 +422,11 @@ public:
|
||||
return reinterpret_cast<const PackedType*>(Value::getType());
|
||||
}
|
||||
|
||||
/// @returns the value for an packed integer constant of the given type that
|
||||
/// has all its bits set to true.
|
||||
/// @brief Get the all ones value
|
||||
static ConstantPacked *getAllOnesValue(const PackedType *Ty);
|
||||
|
||||
/// isNullValue - Return true if this is the value that would be returned by
|
||||
/// getNullValue. This always returns false because zero arrays are always
|
||||
/// created as ConstantAggregateZero objects.
|
||||
|
@ -146,6 +146,18 @@ ConstantIntegral *ConstantIntegral::getAllOnesValue(const Type *Ty) {
|
||||
}
|
||||
}
|
||||
|
||||
/// @returns the value for an packed integer constant of the given type that
|
||||
/// has all its bits set to true.
|
||||
/// @brief Get the all ones value
|
||||
ConstantPacked *ConstantPacked::getAllOnesValue(const PackedType *Ty) {
|
||||
std::vector<Constant*> Elts;
|
||||
Elts.resize(Ty->getNumElements(),
|
||||
ConstantIntegral::getAllOnesValue(Ty->getElementType()));
|
||||
assert(Elts[0] && "Not a packed integer type!");
|
||||
return cast<ConstantPacked>(ConstantPacked::get(Elts));
|
||||
}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ConstantXXX Classes
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user