TargetData.cpp::getTypeInfo() was returning alignment of element type as the
[oota-llvm.git] / lib / Target / TargetData.cpp
index 40b762d8e7392285fdc4b9e90ee1ae613694e8cf..63c5b6178a3f8803e52e8dddb376babc2bb4a029 100644 (file)
@@ -215,6 +215,9 @@ static inline void getTypeInfo(const Type *Ty, const TargetData *TD,
     getTypeInfo(PTy->getElementType(), TD, Size, Alignment);
     unsigned AlignedSize = (Size + Alignment - 1)/Alignment*Alignment;
     Size = AlignedSize*PTy->getNumElements();
+    // FIXME: The alignments of specific packed types are target dependent.
+    // For now, just set it to be equal to Size.
+    Alignment = Size;
     return;
   }
   case Type::StructTyID: {