[Alignment][NFC] Transition and simplify calls to DL::getABITypeAlignment
This patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Differential Revision: https://reviews.llvm.org/D82956
This commit is contained in:
@@ -52,7 +52,7 @@ StructLayout::StructLayout(StructType *ST, const DataLayout &DL) {
|
||||
// Loop over each of the elements, placing them in memory.
|
||||
for (unsigned i = 0, e = NumElements; i != e; ++i) {
|
||||
Type *Ty = ST->getElementType(i);
|
||||
const Align TyAlign(ST->isPacked() ? 1 : DL.getABITypeAlignment(Ty));
|
||||
const Align TyAlign = ST->isPacked() ? Align(1) : DL.getABITypeAlign(Ty);
|
||||
|
||||
// Add padding if necessary to align the data element properly.
|
||||
if (!isAligned(TyAlign, StructSize)) {
|
||||
|
||||
Reference in New Issue
Block a user