From a94cee5109effda6273e7ee47fee5b1dbad337d8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 1 Dec 2004 17:14:28 +0000 Subject: [PATCH] Initial support for packed types, contributed by Morten Ofstad llvm-svn: 18406 --- lib/Target/TargetData.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 594c33588ef..fc58f577497 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -175,6 +175,13 @@ static inline void getTypeInfo(const Type *Ty, const TargetData *TD, Size = AlignedSize*ATy->getNumElements(); return; } + case Type::PackedTyID: { + const PackedType *PTy = cast(Ty); + getTypeInfo(PTy->getElementType(), TD, Size, Alignment); + unsigned AlignedSize = (Size + Alignment - 1)/Alignment*Alignment; + Size = AlignedSize*PTy->getNumElements(); + return; + } case Type::StructTyID: { // Get the layout annotation... which is lazily created on demand. const StructLayout *Layout = TD->getStructLayout(cast(Ty));