summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-12-13 00:46:11 +0000
committerChris Lattner <sabre@nondot.org>2001-12-13 00:46:11 +0000
commit6650d1889274aaf7d9356bd72f56b5504ae63056 (patch)
tree2a4df7f0817f2a33b3afca1f4114f84815717217 /llvm/lib
parentf5c6f65e7f461530b5d6e7f6efa80d5e84a046a9 (diff)
downloadbcm5719-llvm-6650d1889274aaf7d9356bd72f56b5504ae63056.tar.gz
bcm5719-llvm-6650d1889274aaf7d9356bd72f56b5504ae63056.zip
Not just arrays are unsized
llvm-svn: 1450
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/TargetData.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index 09bc6009dc8..a2383d12a2a 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud