diff options
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r-- | lib/Target/TargetData.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 69a8ca902b..f83adefbee 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -48,10 +48,7 @@ StructLayout::StructLayout(const StructType *ST, const TargetData &TD) { // Loop over each of the elements, placing them in memory... for (unsigned i = 0, e = NumElements; i != e; ++i) { const Type *Ty = ST->getElementType(i); - unsigned TyAlign = ST->isPacked() ? - 1 : TD.getABITypeAlignment(Ty); - uint64_t TySize = ST->isPacked() ? - TD.getTypeStoreSize(Ty) : TD.getABITypeSize(Ty); + unsigned TyAlign = ST->isPacked() ? 1 : TD.getABITypeAlignment(Ty); // Add padding if necessary to align the data element properly... StructSize = (StructSize + TyAlign - 1)/TyAlign * TyAlign; @@ -60,7 +57,7 @@ StructLayout::StructLayout(const StructType *ST, const TargetData &TD) { StructAlignment = std::max(TyAlign, StructAlignment); MemberOffsets[i] = StructSize; - StructSize += TySize; // Consume space for this data item + StructSize += TD.getABITypeSize(Ty); // Consume space for this data item } // Empty structures have alignment of 1 byte. |