clean up load and stores alot
[oota-llvm.git] / lib / Target / TargetData.cpp
index a57d6ba2fba8b1f77998d39f98ddb4ddbf9b9af1..fc58f577497143d12d2ae23afcac08fb3cf72f6d 100644 (file)
@@ -107,7 +107,7 @@ TargetData::TargetData(const std::string &ToolName, const Module *M) {
   PointerAlignment = PointerSize;
   DoubleAlignment  = PointerSize;
   FloatAlignment   = 4;
-  LongAlignment    = 8;
+  LongAlignment    = PointerSize;
   IntAlignment     = 4;
   ShortAlignment   = 2;
   ByteAlignment    = 1;
@@ -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));