aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/ValueTypes.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h
index 1a08f4d608..2846eb02db 100644
--- a/include/llvm/CodeGen/ValueTypes.h
+++ b/include/llvm/CodeGen/ValueTypes.h
@@ -444,8 +444,11 @@ namespace llvm {
/// getIntegerVTBitMask - Return an integer with 1's every place there are
/// bits in the specified integer value type. FIXME: Should return an apint.
uint64_t getIntegerVTBitMask() const {
- assert(isInteger() && !isVector() && "Only applies to int scalars!");
- return ~uint64_t(0UL) >> (64-getSizeInBits());
+ assert(isInteger() && "Only applies to integers!");
+ MVT EltVT = isVector() ? getVectorElementType() : *this;
+ assert(EltVT.getSizeInBits() <= 64 &&
+ "getIntegerVTBitMask doesn't use APInt!");
+ return ~uint64_t(0UL) >> (64-EltVT.getSizeInBits());
}
/// getIntegerVTSignBit - Return an integer with a 1 in the position of the