[PATCH] D67400: [Alignment][NFC] migrate DataLayout internal struct to llvm::Align

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 08:01:04 PDT 2019


courbet added inline comments.


================
Comment at: llvm/lib/IR/DataLayout.cpp:54
     Type *Ty = ST->getElementType(i);
-    unsigned TyAlign = ST->isPacked() ? 1 : DL.getABITypeAlignment(Ty);
+    llvm::Align TyAlign(ST->isPacked() ? 1 : DL.getABITypeAlignment(Ty));
 
----------------
const


================
Comment at: llvm/lib/IR/DataLayout.cpp:369
 
-      setAlignment(AlignType, ABIAlign, PrefAlign, Size);
+      if (!isUInt<16>(PrefAlign))
+        report_fatal_error(
----------------
I would move this back to `DataLayout::setAlignment`, or ask for a review to the original authors. They might have had other reasons beyond storage for guarding against this size.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67400/new/

https://reviews.llvm.org/D67400





More information about the llvm-commits mailing list