[PATCH] D43734: [RecordLayout] Don't align to non-power-of-2 sizes when using -mms-bitfields

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 24 23:07:04 PST 2018


mstorsjo added inline comments.


================
Comment at: lib/AST/RecordLayoutBuilder.cpp:1755
         CharUnits TypeSize = Context.getTypeSizeInChars(BTy);
-        if (TypeSize > FieldAlign)
+        if (TypeSize > FieldAlign &&
+            llvm::isPowerOf2_64(TypeSize.getQuantity()))
----------------
compnerd wrote:
> Can you add an assertion that the size is a power of two unless it is the GNU environment?
Sure, done.


https://reviews.llvm.org/D43734





More information about the cfe-commits mailing list