aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/DerivedTypes.h
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-01-07 23:44:27 +0000
committerBob Wilson <bob.wilson@apple.com>2009-01-07 23:44:27 +0000
commit850168c370bd6cb18a13f88e32e7ec9c1d0abf04 (patch)
tree77777b8bb8d437e91a64a3d32a62ef409781611a /include/llvm/DerivedTypes.h
parent71c3f459905097a54b9bd354b1e18d74bee87721 (diff)
downloadexternal_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.h2
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());
}