StructAlignment = std::max(TyAlign, StructAlignment);
MemberOffsets[i] = StructSize;
- StructSize += TD.getTypePaddedSize(Ty); // Consume space for this data item
+ StructSize += TD.getTypeAllocSize(Ty); // Consume space for this data item
}
// Empty structures have alignment of 1 byte.
return getPointerSizeInBits();
case Type::ArrayTyID: {
const ArrayType *ATy = cast<ArrayType>(Ty);
- return getTypePaddedSizeInBits(ATy->getElementType())*ATy->getNumElements();
+ return getTypeAllocSizeInBits(ATy->getElementType())*ATy->getNumElements();
}
case Type::StructTyID:
// Get the layout annotation... which is lazily created on demand.
// Get the array index and the size of each array element.
int64_t arrayIdx = cast<ConstantInt>(Indices[CurIDX])->getSExtValue();
- Result += arrayIdx * (int64_t)getTypePaddedSize(Ty);
+ Result += arrayIdx * (int64_t)getTypeAllocSize(Ty);
}
}