================
@@ -89,6 +90,13 @@ createAArch64TargetInfo(TypeBuilder &TB, const 
AArch64ABIOptions &Opts) {
   return std::make_unique<AArch64TargetInfo>(TB, Opts);
 }
 
+// Alignment of an integer coercion of \p BitWidth bits. The width is
+// rounded up to a whole number of bytes, then to a power of two.
+static llvm::Align alignForIntegerBits(uint64_t BitWidth) {
+  uint64_t Bytes = llvm::divideCeil(BitWidth, 8);
+  return llvm::Align(llvm::PowerOf2Ceil(std::max<uint64_t>(Bytes, 1)));
+}
----------------
madhur13490 wrote:

Nit: the std::max(Bytes, 1) can't trigger, since size 0 returns early. More 
broadly, does anything on the Clang side actually read the alignment of the 
coerced integer? If not, I'd just pass an Align directly like X86/BPF do and 
drop the helper.

https://github.com/llvm/llvm-project/pull/230631
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to