]> granicus.if.org Git - clang/commitdiff
[TargetInfo] Use llvm::alignOf() instead of rewriting it. NFCI.
authorDavide Italiano <davide@freebsd.org>
Mon, 3 Apr 2017 16:51:39 +0000 (16:51 +0000)
committerDavide Italiano <davide@freebsd.org>
Mon, 3 Apr 2017 16:51:39 +0000 (16:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299364 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp

index 34128f32213cf5731f8fe3c878e7b8c519473028..fadbcea9b03de87f75591cc5f8d1cff59ba5a9a7 100644 (file)
@@ -4917,7 +4917,7 @@ ABIArgInfo AArch64ABIInfo::classifyArgumentType(QualType Ty) const {
       return coerceToIntArray(Ty, getContext(), getVMContext());
     }
     unsigned Alignment = getContext().getTypeAlign(Ty);
-    Size = 64 * ((Size + 63) / 64); // round up to multiple of 8 bytes
+    Size = llvm::alignTo(Size, 64); // round up to multiple of 8 bytes
 
     // We use a pair of i64 for 16-byte aggregate with 8-byte alignment.
     // For aggregates with 16-byte alignment, we use i128.
@@ -4967,7 +4967,7 @@ ABIArgInfo AArch64ABIInfo::classifyReturnType(QualType RetTy) const {
       return coerceToIntArray(RetTy, getContext(), getVMContext());
     }
     unsigned Alignment = getContext().getTypeAlign(RetTy);
-    Size = 64 * ((Size + 63) / 64); // round up to multiple of 8 bytes
+    Size = llvm::alignTo(Size, 64); // round up to multiple of 8 bytes
 
     // We use a pair of i64 for 16-byte aggregate with 8-byte alignment.
     // For aggregates with 16-byte alignment, we use i128.