From: Chris Lattner Date: Wed, 1 Dec 2004 17:14:28 +0000 (+0000) Subject: Initial support for packed types, contributed by Morten Ofstad X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=527efc6742a92d88c9052494e5f0da7a4234c41e;p=oota-llvm.git Initial support for packed types, contributed by Morten Ofstad git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18406 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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));