diff options
author | Chris Lattner <sabre@nondot.org> | 2001-12-13 00:46:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-12-13 00:46:11 +0000 |
commit | f59ce9276349598ed46bbd1bdc0011b7e2b211b4 (patch) | |
tree | e10002349b8b9067b5a6149011fd6b2b32e2967a /lib/Target/TargetData.cpp | |
parent | 9102aee52827790c94051df70c83fe5034bc9ff7 (diff) | |
download | external_llvm-f59ce9276349598ed46bbd1bdc0011b7e2b211b4.zip external_llvm-f59ce9276349598ed46bbd1bdc0011b7e2b211b4.tar.gz external_llvm-f59ce9276349598ed46bbd1bdc0011b7e2b211b4.tar.bz2 |
Not just arrays are unsized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r-- | lib/Target/TargetData.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 09bc600..a2383d1 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -95,6 +95,7 @@ TargetData::~TargetData() { static inline void getTypeInfo(const Type *Ty, const TargetData *TD, unsigned &Size, unsigned char &Alignment) { + assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"); switch (Ty->getPrimitiveID()) { case Type::VoidTyID: case Type::BoolTyID: @@ -114,7 +115,6 @@ static inline void getTypeInfo(const Type *Ty, const TargetData *TD, return; case Type::ArrayTyID: { const ArrayType *ATy = (const ArrayType *)Ty; - assert(ATy->isSized() && "Can't get TypeInfo of an unsized array!"); getTypeInfo(ATy->getElementType(), TD, Size, Alignment); Size *= ATy->getNumElements(); return; |