Assert that elements of packed are pointer/float/opaque.
authorReid Spencer <rspencer@reidspencer.com>
Sat, 10 Feb 2007 22:02:45 +0000 (22:02 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sat, 10 Feb 2007 22:02:45 +0000 (22:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34165 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Type.cpp

index 34bedbb00a319cb362c425999243d79f23f0162e..1f843a275b4552cf75c93fe4252664f0d922d37a 100644 (file)
@@ -426,6 +426,10 @@ PackedType::PackedType(const Type *ElType, unsigned NumEl)
   NumElements = NumEl;
   setAbstract(ElType->isAbstract());
   assert(NumEl > 0 && "NumEl of a PackedType must be greater than 0");
+  assert((ElType->isInteger() || ElType->isFloatingPoint() || 
+          isa<OpaqueType>(ElType)) && 
+         "Elements of a PackedType must be a primitive type");
+
 }