diff options
author | Chris Lattner <sabre@nondot.org> | 2004-12-01 17:14:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-12-01 17:14:28 +0000 |
commit | 527efc6742a92d88c9052494e5f0da7a4234c41e (patch) | |
tree | 2611ac931621b1533903109695b7e8c6bde09dc3 /lib/Target/TargetData.cpp | |
parent | f71755dc56240a393ad822058f439fe120a1ccbd (diff) |
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
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r-- | lib/Target/TargetData.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 594c33588e..fc58f57749 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<PackedType>(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<StructType>(Ty)); |