aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DataLayout.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2020-07-01 14:31:56 +0000
committerGuillaume Chatelet <gchatelet@google.com>2020-07-01 14:31:56 +0000
commitd3085c25012aceef3755abf9921a0368c64f40c6 (patch)
tree5f0a3cdb0a6bfbe94479565f5b715baf3c0be1b3 /llvm/lib/IR/DataLayout.cpp
parent27bbc8ede127fb1ea8b6a853a5d2fe70f206408b (diff)
downloadllvm-d3085c25012aceef3755abf9921a0368c64f40c6.zip
llvm-d3085c25012aceef3755abf9921a0368c64f40c6.tar.gz
llvm-d3085c25012aceef3755abf9921a0368c64f40c6.tar.bz2
[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
Diffstat (limited to 'llvm/lib/IR/DataLayout.cpp')
-rw-r--r--llvm/lib/IR/DataLayout.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index b0613c8..25fed92 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -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)) {