diff options
author | Bob Wilson <bob.wilson@apple.com> | 2009-01-07 23:44:27 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2009-01-07 23:44:27 +0000 |
commit | 850168c370bd6cb18a13f88e32e7ec9c1d0abf04 (patch) | |
tree | 77777b8bb8d437e91a64a3d32a62ef409781611a /include/llvm/DerivedTypes.h | |
parent | 71c3f459905097a54b9bd354b1e18d74bee87721 (diff) | |
download | external_llvm-850168c370bd6cb18a13f88e32e7ec9c1d0abf04.zip external_llvm-850168c370bd6cb18a13f88e32e7ec9c1d0abf04.tar.gz external_llvm-850168c370bd6cb18a13f88e32e7ec9c1d0abf04.tar.bz2 |
Assert that VectorType::getTruncatedElementVectorType is not used with
odd bit-width vector elements. Add a check in the verifier for this also.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/DerivedTypes.h')
-rw-r--r-- | include/llvm/DerivedTypes.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h index 3bc00e9..24681a5 100644 --- a/include/llvm/DerivedTypes.h +++ b/include/llvm/DerivedTypes.h @@ -385,6 +385,8 @@ public: /// static VectorType *getTruncatedElementVectorType(const VectorType *VTy) { unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits(); + assert((EltBits & 1) == 0 && + "Cannot truncate vector element with odd bit-width"); const Type *EltTy = IntegerType::get(EltBits / 2); return VectorType::get(EltTy, VTy->getNumElements()); } |