summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-01 17:14:28 +0000
committerChris Lattner <sabre@nondot.org>2004-12-01 17:14:28 +0000
commite58bf09138c01b1a1c3461eb844ed1a4cd092db7 (patch)
treeecc02f93331daac51de39b4dd36422ce84cac9bb /llvm/lib
parent9a43d294b9abbd80aa4c73572058bfdf5b96a78b (diff)
downloadbcm5719-llvm-e58bf09138c01b1a1c3461eb844ed1a4cd092db7.tar.gz
bcm5719-llvm-e58bf09138c01b1a1c3461eb844ed1a4cd092db7.zip
Initial support for packed types, contributed by Morten Ofstad
llvm-svn: 18406
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/TargetData.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index 594c33588ef..fc58f577497 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/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));
OpenPOWER on IntegriCloud